Browse documentation
API reference
Google Search API
Retrieve organic results, related questions and rich results from Google Search as structured JSON. Filter by country, language and location.
Build a request
Advanced parameters
Starts at 1. Each page is a separate request.
Google time filter, such as qdr:d for the past day.
https://data.flashdata.dev/v1/queries/realtimeParameters
Send source and query at the top level. Source options belong in params. Optional fields can be omitted.
Request body
sourcestring / Required- Set to google_search.
querystring / Required- Search query. Supports Google search operators such as site: and intitle:.1 to 2,000 charactersDefault:
Not set paramsobject / Optional- Settings for this request.Default:
{} callback_urlstring · nullable / Optional- Async and batch only. Public HTTPS completion URL on port 443, up to 2,048 characters. No user credentials or URL fragment. Omit, use null or an empty string for no notification. In a batch, set this on each query, outside params.Default:
Not set
Country, language & location
params.glstring / Optional- Two-letter country code, such as us, gb, de or sg. Set explicitly to select a country.Exactly 2 charactersDefault:
Not setAccepted format
^[A-Za-z]{2}$ params.hlstring / Optional- Google interface language. Set explicitly to select a language.1 to 35 charactersDefault:
Not setAccepted format
^[A-Za-z0-9-]+$ params.locationstring / Optional- Requested search location, preferably a city, such as "London, England, United Kingdom". Availability depends on the search type.1 to 200 charactersDefault:
Not set
Pagination
params.numinteger / Optional- Requested result count. FlashData does not add a fixed default when omitted. The returned count can differ by query and search type.1 to 100, whole numbersDefault:
Not set params.pageinteger / Optional- Requested result page. Set explicitly. Each page is a separate API request.1 to 100, whole numbersDefault:
Not set
Search filters
params.tbsstring / Optional- Requested Google search filters, such as qdr:d for the past day or qdr:w for the past week. Availability depends on the search type.1 to 200 charactersDefault:
Not set params.autocorrectboolean / Optional- Request spelling correction with true or request it disabled with false. Applied behavior depends on the search type; omit to use Google's behavior.
trueorfalseDefault:Not set
Response
Realtime returns status: done with the search output in results[0]. Matches are in results[0].organic. usage.credits records the charge.
Organic matches include titles, links and snippets. Related questions and rich results are optional.
Read the result
Save the successful JSON response as response.json. Save this as read-response.py and run python read-response.py. It uses only Python's standard library and makes no new request.
import json
from pathlib import Path
response = json.loads(Path("response.json").read_text(encoding="utf-8-sig"))
if response.get("status") not in ("done", "completed") or not isinstance(response.get("results"), list):
raise SystemExit("Expected completed result JSON; inspect the response or job status.")
if not response["results"]:
print("[]")
raise SystemExit(0)
result = response["results"][0]
output = [
{"title": item.get("title"), "url": item.get("link"), "snippet": item.get("snippet")}
for item in result.get("organic", [])
]
print(json.dumps(output, ensure_ascii=False, indent=2))Available fields depend on the query and search type. Optional fields may be absent, and additional fields may be returned.
The number of returned items and searchParameters.num can differ from params.num. Use the returned array to determine the actual result count.
All response fields
| Field | Description |
|---|---|
sourcestring | The requested API source. |
statusstring | done when the realtime request succeeds. |
created_atstring | Response creation time in ISO 8601 format. |
usage.creditsnumber | Credits charged for the request, based on your plan. |
results[0].searchParametersobject | Search settings reported by Google, with the query recorded as q. Returned settings may differ from the requested values. |
results[0].organicarray | Organic results with title, link, snippet and position, plus additional fields when available. |
results[0].peopleAlsoAskarray · optional | Related questions, with answers and source links when available. |
results[0].relatedSearchesarray · optional | Related search terms, each with a query field. |
results[0].knowledgeGraphobject · optional | Entity information from the knowledge panel. |
results[0].answerBoxobject · optional | Featured answer. Fields vary with the answer type. |
The fields above describe the default JSON response. JSON, plain text and Markdown formats.
Async & batch lifecycle
Submission returns a receipt, not results. Async creates one job; batch returns a separate job in queries[] for every accepted query. Track and retrieve each job independently.
Submit to data.flashdata.dev; read job status and results from api.flashdata.dev with the same X-API-Key. The linked API basics examples use Python and cURL.
1. Save the job IDs
Keep this source's request fields when switching to Async. For Batch, put each request inside the queries array of a JSON object. Save every returned job ID.
2. Check status
GET https://api.flashdata.dev/v2/jobs/{jobId}pending/processing: poll with a delay and respectRetry-Afterwhen present.completed: fetch results.failed: inspectjob.error.Read job.status, not the submission receipt's status.
Check status · Python and cURL
Job status API reference3. Fetch results
GET https://api.flashdata.dev/v2/jobs/{jobId}/resultsAfter completion, authenticate the result read, then fetch the 302 storage URL without your API key. Save the JSON within 24 hours of completion.
Fetch results · Python and cURL · Response formats
Result download API reference
Polling and fetching existing results do not consume query credits. A polling timeout does not cancel the job: keep its ID instead of submitting duplicate billable work. Error codes and retry behavior.
Completion webhooks
Subscribe per query
Set callback_url at the top level of an async request, or inside each query in a batch, outside params. No separate webhook-registration request is required. Realtime requests do not send callbacks.
Use a public HTTPS URL on port 443. FlashData POSTs a notification for each job reaching completed or failed; the event contains links, not the result itself.
Acknowledge and verify
Return 2xx after durably accepting the event. Deduplicate by delivery_id, also sent as X-Delivery-Id. Redirects are not followed.
Failed deliveries retry with exponential backoff, up to 8 attempts total and at most 24 hours after completion. Keep polling as a fallback.
Callbacks are unsigned. Confirm the job ID, source and terminal status through the authenticated status endpoint before processing the notification. The delivery ID is for deduplication, not proof of authenticity.
Example webhook event and fields
{
"delivery_id": "completion:job_example0001",
"id": "job_example0001",
"source": "google_search",
"status": "completed",
"links": [
{
"rel": "self",
"href": "https://api.flashdata.dev/v2/jobs/job_example0001",
"method": "GET"
},
{
"rel": "results",
"href": "https://api.flashdata.dev/v2/jobs/job_example0001/results",
"method": "GET"
}
]
}| Field | Description |
|---|---|
delivery_idstring | Stable delivery identifier. Deduplicate notifications using this value; it is also sent in the X-Delivery-Id header. |
idstring | Job ID. |
sourcestring | Requested data source. |
statusstring | completed or failed. |
linksarray | Status and result links. Notifications do not include result content or an API key. |
links[].relstring | self or results. |
links[].hrefstring | Absolute Management API URL; authenticate with your API key. |
links[].methodstring | GET. |
Error recovery
A completed search may contain fewer matches than requested. Check gl, hl, location and filters; optional rich-result fields may be absent.
For authentication, balance, request-format and rate-limit failures, use the shared error reference. A submission timeout may still have created a job; check existing work before retrying.
Step-by-step guide: Choose and refine a Google search
Pricing
| Plans | Usage ratesper 1,000 requests | Subscriptions | Included credits per billing period |
|---|---|---|---|
| Pay as you go | $1.00 | No monthly fee | Top up as needed |
| Micro | $0.80 | $49.00 / month | 1,000 credits ($50.00 of API usage) included |
| Starter | $0.65 | $199.00 / month | 4,000 credits ($200.00 of API usage) included |
| Pro | $0.60 | $499.00 / month | 10,000 credits ($500.00 of API usage) included |
| Scale | $0.50 | $999.00 / month | 20,000 credits ($1,000.00 of API usage) included |
| Business | $0.40 | $1,999.00 / month | 40,000 credits ($2,000.00 of API usage) included |
One account plan. Shared Credits across all three products. Usage covered by included credits is not charged again.
Current prices and plan limits