Getting API keys#
Step-by-step guides for obtaining each provider’s key. None are required to boot Searpa, but at least one web engine (Brave is the easiest) is needed for useful results. Each provider you skip simply hides its tab or card, see Search providers for what each one enables.
Once you have a key, set the matching environment variable (see Configuration) and restart the app.
All of these have a free tier that is generous enough for a personal or small-team instance, Searpa caches aggressively and only calls the paid card APIs when a query actually matches. The shared keys (
publicfor Marginalia, anonymous Stack Exchange) need no signup at all.
Brave Search — BRAVE_API_KEY#
Powers the Web, Images, News and Videos tabs from one key. This is the one provider worth setting up first.
- Go to the Brave Search API site and sign up for the API dashboard.
- Add the Data for Search plan and pick the Free tier (it asks for a card to verify, but the free tier is not billed).
- Open API Keys in the dashboard and generate a key.
- Copy it into
BRAVE_API_KEY.
Brave Suggest (autocomplete) — BRAVE_SUGGEST_API_KEY#
Enables search-bar autocomplete. This is a separate subscription from the search key above, with its own key.
- In the same Brave API dashboard, subscribe to the Autosuggest plan (Free tier available).
- Generate a key for that subscription.
- Copy it into
BRAVE_SUGGEST_API_KEY.
Leave it unset to run without autocomplete; everything else still works.
Mojeek — MOJEEK_API_KEY#
Adds the independent Mojeek web index to the Web tab.
- Visit the Mojeek Search API page and request API access (a free tier is available).
- Once approved, copy the key they issue.
- Set it as
MOJEEK_API_KEY.
Marginalia — MARGINALIA_API_KEY#
Adds the non-commercial, small-web Marginalia index. No signup required.
- The literal value
publicis a free shared key and is the default in.env.example, rate-limited to roughly 1 request every 5 seconds. - For a higher, non-shared quota, request a personal key on the Marginalia API page.
MARGINALIA_API_KEY=public # works out of the boxPixabay (images) — PIXABAY_API_KEY#
Blends royalty-free Pixabay images into the Images tab.
- Create a free account at Pixabay.
- While logged in, open the Pixabay API docs, your personal API key is shown at the top of that page.
- Copy it into
PIXABAY_API_KEY.
World News API (news) — WORLDNEWS_API_KEY#
Blends articles from the World News API into the News tab.
- Sign up at worldnewsapi.com (the free plan grants a daily points allowance).
- Open your account dashboard and copy the API key.
- Set it as
WORLDNEWS_API_KEY.
TMDB (film / TV card) — TMDB_API_KEY#
Enables the film / TV knowledge card.
- Create a free account at The Movie Database.
- Go to Settings → API (direct link) and request a Developer key (instant, free; you fill in a short form).
- Copy the API Key (v3 auth) value into
TMDB_API_KEY.
TripAdvisor (places card) — TRIPADVISOR_API_KEY#
Enables the restaurant / hotel / attraction card.
- Sign up for the TripAdvisor Content API.
- In the developer portal, create an API key (the free tier includes a monthly call allowance).
- Copy it into
TRIPADVISOR_API_KEY.
The TripAdvisor Content API requires showing TripAdvisor attribution where its data appears, which Searpa’s card already does. You can also restrict the key to your server’s IP in their portal.
Stack Exchange (Q&A card) — STACKEXCHANGE_API_KEY#
Enables the Stack Exchange question-and-answer card. A key is optional.
Without a key, Searpa uses the shared anonymous quota (10,000 requests/day shared across all anonymous callers), which is fine for low traffic.
With a key, you get a dedicated, much higher quota:
- Register an app at Stack Apps → Register OAuth (use your instance’s URL; you don’t need the OAuth flow).
- Copy the generated Key.
- Set it as
STACKEXCHANGE_API_KEY.
Providers that need no key#
These work out of the box, no account, no key:
| Provider | Used for |
|---|---|
| OpenStreetMap / Nominatim | The Maps tab and map quick-answers |
| Wikipedia / Wikidata | The Wikipedia knowledge card and subject detection |
| Sepia / PeerTube | The Videos tab’s supplementary provider |
| Open-Meteo | The weather instant answer |
| Frankfurter | The currency instant answer |
The Translate tab is the one keyless feature that still needs infrastructure: a LibreTranslate instance you point Searpa at, see Translation.
After adding keys#
- Put each value in your environment (or
.env), see Configuration. - Restart the app so it picks up the new variables.
- Check the
/statuspage (or thestatus/API endpoint) to confirm each provider is reporting healthy.