String Web Access API
API Reference

POST /search

Run a Google search and return the top organic results.

POST https://request.usestring.ai/v1/search

Request body

FieldTypeDefaultDescription
querystringRequired. The search query to run.
enginestring"google"Search engine to query. "google" or "duckduckgo".
countrystring"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."
    }
  ]
}
FieldTypeDescription
positioninteger1-based rank on the results page.
titlestringResult title.
urlstringDestination URL.
displayUrlstringHuman-readable URL shown beneath the title.
snippetstringResult description text.

Status codes

StatusMeaning
200Search completed.
400Validation error (missing query, invalid country, or an unrecognized field).
401Missing or invalid API key.
402Insufficient account balance.
429Rate limit exceeded.
500Internal error.

See Search overview for billing.