Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Every engine is the same GET /api/v1/search with a different engine value; the engine’s own parameters follow.
- The key goes in the Authorization header as a Bearer token; the docs also accept it as an api_key query parameter, which this file does not use.
- A bad key is HTTP 401 with {“error”: “Invalid API key.”} (called live on 2026-11-24).
- Only successful searches, those answered with HTTP 200, are billed (pricing page).
- Paging is by page number (1-based). Google phased out num in September 2025, so a Google web page holds at most 10 organic results and num is left out here; Bing pages with next_page_token.
- A Google result that is a redirect carries a link_token instead of a final URL; the Google Resolve API turns it into the destination.
- search_metadata.status is Success or Error, and search_metadata.json_url and html_url point at the stored copy of the response.
Endpoints
Google search
- Each page holds at most 10 organic results (Google phased out num in September 2025); page=2 is results 11 to 20.
- organic_results[] carries position, title, link, domain, displayed_link, snippet and source; a redirect result has a link_token for the Google Resolve API instead of its destination URL.
Google News search
- A site: operator makes Google answer with a Google Search page instead of Google News.
Google Maps search
Google Shopping search
Google Images search
Google Videos search
Google Scholar search
Google Jobs search
- Paging is by next_page_token from the previous response, not by page number.
Google Trends
Google Autocomplete
Bing search
- Bing’s first page can hold fewer than 10 organic results, so page=2 may skip some; next_page_token continues exactly where the last response ended.
- num has no effect on Bing any more and is left out.
YouTube search
- Paging goes through sp: send the next-page value from the previous response as sp.