API Reference
POST /search
Run a Google search and return the top organic results.
POST https://request.usestring.ai/v1/searchRequest body
| Field | Type | Default | Description |
|---|---|---|---|
query | string | — | Required. The search query to run. |
engine | string | "google" | Search engine to query. "google" or "duckduckgo". |
country | string | "US" | Country used to localize results. Currently supports "US" and "GB". |
Any other field is rejected with a 400.
Country codes are case-insensitive and normalized to uppercase, so "gb" and "GB" behave the same way. The
country applies to both Google and DuckDuckGo searches.
curl https://request.usestring.ai/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "construction consulting firms", "country": "GB" }'Response
{
"results": [
{
"position": 1,
"title": "Example Result Title",
"url": "https://example.com/page",
"displayUrl": "https://example.com › page",
"snippet": "A short description of the page as shown on the results page."
}
]
}| Field | Type | Description |
|---|---|---|
position | integer | 1-based rank on the results page. |
title | string | Result title. |
url | string | Destination URL. |
displayUrl | string | Human-readable URL shown beneath the title. |
snippet | string | Result description text. |
Status codes
| Status | Meaning |
|---|---|
200 | Search completed. |
400 | Validation error (missing query, invalid country, or an unrecognized field). |
401 | Missing or invalid API key. |
402 | Insufficient account balance. |
429 | Rate limit exceeded. |
500 | Internal error. |
See Search overview for billing.