Web Search
GET/v1/google/search1 credit
Returns Google web search results for a query: 10 results per page, each with title, URL and description.
01Query parameters
| Name | Type | Description |
|---|---|---|
| queryrequired | string | Search terms. |
| pageoptional | integer | Result page, from 1 to 11.Default: 1 |
| date_postedoptional | string | Limit results to a recent period. `last-hour` currently behaves like `last-day`.Accepted values:last-hourlast-daylast-weeklast-monthlast-year |
| regionoptional | string | Two-letter country code. Accepted for compatibility; it does not change the results at the moment. |
02Request
curl "https://api.scrapesocial.ai/v1/google/search?query=golang+tutorial" \ -H "x-api-key: $SCRAPESOCIAL_KEY"
03Responses
Real answers from the API. Lists are shortened to 2 items.
GET /v1/google/search?query=golang+tutorial
{
"success": true,
"credits_remaining": 4980,
"credits_charged": 1,
"results": [
{
"title": "Tutorial: Get started with Go - The Go Programming Language",
"url": "https://go.dev/doc/tutorial/getting-started",
"description": "In this tutorial, you'll get a brief introduction to Go programming. Along the way, you will: Install Go (if you haven't already). Write some simple \"Hello, ..."
},
{
"title": "Go Tutorial - W3Schools",
"url": "https://www.w3schools.com/go/",
"description": "Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, ..."
}
],
"next_page": 2
}Common to every endpoint
Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.
GET /v1/cosmos/profile?handle=design
{
"success": false,
"message": "Invalid API key"
}04Notes
Results are in `results`; `next_page` holds the next page number to pass as `page`, and is null on page 11 or when there are no more results. A `page` outside 1 to 11 or an unknown `date_posted` is a free 400. Web search engines also answer loosely related pages when nothing matches, so only results that name the query's words (in their title, snippet or URL) are kept: a query nothing matches answers the empty list for 0 credits.
05Errors & credits
Every error has success: false, a real HTTP status and costs no credits.
400missing_parameter
A required parameter is missing or invalid.
403private_account
The account is private or age-restricted.
404not_found
No such account.
503upstream_error
The platform did not answer; retry shortly.