Search results
The top 10 organic results for one search, with a receipt recording the search URL, fetch time and a hash of the results.
POST
/v1/serpOn this page
Price
Pricerequest
- Live
- $0.00054
Per search that returned results.
Description
One search, run inline. For locations, maps, more depth or queued tasks, use the SERP API routes.
Billing. $0.00054 per search that returned results. A search that fails or returns nothing costs $0.
Request
- Endpoint
- POST https://api.dataforgaio.com/v1/serp
- Authentication
- HTTP Basic auth: any login, with your
dg_API key as the password. ABearerheader with the key also works. Create a key. - Body
- JSON object
Fields
- The search, up to 700 characters.
queryandqare accepted too.Max700Exampletrail running shoes boulder - Search engine.Default
googleOne ofgooglebingExamplegoogle - Two-letter country to search from.Example
US - Language code, for example
enoren-US.Exampleen - Device type.Default
desktopOne ofdesktopmobileExampledesktop - Include the receipt.Default
trueExampletrue - A project in your organization to file this under.
- When the included route returns nothing, retry on the live route (billed at the same price).
falsestops at the included route and the search fails at $0.DefaulttrueExampletrue - The most this search may cost, USD. Below the search price, nothing runs (422
max_cost_exceeded). The charge never exceeds it. - Accept a cached result up to this many seconds old (0 to 86400). Default: always fetch fresh.Min
0Max86400
Response
Shape: Native. Expand a field to see its children; every field has a link anchor.
- statusstringAlways
okfor a 2xx response.Exampleok - costnumberWhat the search was charged, USD.Example
0.00054 - tasks_countintegerAlways 1.Example
1 - tasks_errorinteger1 when the search failed.Example
0 - tasksarray<object>The search.
Show 36 child fieldsHide child fields
- idstringSearch id,
sr_….Examplesr_8cbb5b5c8e155c82995945f93cdad009 - statusstring
completedorfailed.One ofcompletedfailedprocessingExamplecompleted - status_codeinteger200, or 502/503 when it failed.Example
200 - status_messagestringPlain-language status.Example
Ok. - costnumberCharged, USD.Example
0.00054 - contentobjectThe results. Present when completed.
Show 12 child fieldsHide child fields
- querystringThe search.Example
trail running shoes boulder - search_enginestringSearch engine.Example
google - countrystring|nullCountry, lowercase.Example
us - languagestring|nullLanguage.Example
en - devicestringDevice.Example
desktop - items_countintegerEntries in
organic.Example2 - organicarray<object>Organic results in rank order.
Show 5 child fieldsHide child fields
- positionintegerRank, starting at 1.Example
1 - titlestringResult title.Example
Trail running shoes | Summit Running Co. - urlstringResult URL.Example
https://summitrunning.example/trail-shoes - domainstringResult domain.Example
summitrunning.example - snippetstringResult snippet.Example
Every trail shoe we stock, fitted after a free gait analysis.
- errorobjectPresent when failed.
Show 2 child fieldsHide child fields
- http_statusintegerSame as
status_code. - codestringError code.
- receiptobjectProvenance and cost. Present unless
include_receiptis false.Show 14 child fieldsHide child fields
- receipt_idstringReceipt id,
rc_….Examplerc_8cbb5b5c8e155c82995945f93cdad009 - source_urlstring|nullThe public search URL the results correspond to.Example
https://www.google.com/search?q=trail+running+shoes+boulder&num=10&gl=us&hl=en - fetched_atstring|nullWhen the results were fetched, ISO 8601 UTC.Example
2026-12-03T10:42:18Z - http_statusinteger|nullHTTP status of the search.Example
200 - content_sha256string|nullSHA-256 of the results we returned.Example
b085e457d70d4053268da555d16037247e5d54ee16e182e7fca462347c269520 - content_checknullAlways null for a search.
- robots_txtnullAlways null for a search.
- ai_use_signalnullAlways null for a search.
- fetch_methodstringAlways
serp_api.Exampleserp_api - cache_hitbooleanTrue when a cached result (within
max_age) answered.Examplefalse - upgradedbooleanTrue when the live route answered after the included route didn't.Example
false - unit_cost_usdnumber|nullCharged, USD.Example
0.00054 - billed_usdnumber|nullSame as
unit_cost_usd.Example0.00054 - currencystringAlways
USD.ExampleUSD
Errors
| Code | When |
|---|---|
| invalid_request | HTTP 400. The body failed validation. error.details maps each field to its problem. |
| unauthorized | HTTP 401. Missing, malformed or revoked API key. |
| balance_required | HTTP 402. Your wallet balance is below the most this request could cost. Nothing ran. |
| max_cost_exceeded | HTTP 422. max_cost is below the price of one search. |
| rate_limited | HTTP 429. Too many requests, or too many inline requests in flight for your organization. Honor Retry-After. |
| upstream_error | HTTP 502. The target or search timed out or returned an error we couldn't recover from. You weren't billed. |
| not_configured | HTTP 503. The service behind this route isn't set up on this server. You weren't billed. |
Tasks that end in an error are not billed. All status codes