webstractor
Developer docs

Autocomplete

Finish the query before searching.

Turn partial input into up to ten ordered suggestions for web, shopping, videos, news, images, places, or travel. Every result links directly to the matching Webstractor search request.

Request

curl --get 'https://api.webstractor.com/v1/autocomplete' \
  --data-urlencode 'q=cloudflare wor' \
  --data-urlencode 'format=json'

curl --get 'https://api.webstractor.com/v1/autocomplete' \
  --data-urlencode 'q=headphones' \
  --data-urlencode 'type=shopping' \
  --data-urlencode 'format=json'
ParameterRequiredDescription
qYesA partial search query of up to 200 characters.
limitNoAn integer from 1 to 10. Default: 10.
typeNoweb (default), shopping, videos, news, images, places, or travel. maps is accepted as an alias of places.
languageNoCanonical BCP 47 language tag. Default: en-US.
countryNoTwo-letter ISO country code. Default: US.
formatNojson (default) or markdown.

JSON response

JSON uses schema version 1 with type: "feed" and source: "autocomplete". Suggestions are content-free document items in rank order. Their url fields call the matching search contract: /v1/search for web and shopping, /v1/videos, /v1/news, /v1/images, /v1/places, or /v1/flights/autocomplete for travel.

{
  "schemaVersion": 1,
  "type": "feed",
  "source": "autocomplete",
  "id": "autocomplete:sha256:…",
  "url": "https://api.webstractor.com/v1/autocomplete?q=cloudflare+wor&format=json",
  "title": "Autocomplete suggestions for cloudflare wor",
  "author": null,
  "publishedAt": null,
  "media": [],
  "attributes": {
    "feedType": "autocomplete",
    "autocompleteType": "web",
    "query": "cloudflare wor",
    "language": "en-US",
    "country": "US",
    "resultCount": 2
  },
  "items": [
    {
      "type": "document",
      "source": "autocomplete",
      "id": null,
      "url": "https://api.webstractor.com/v1/search?q=cloudflare+workers",
      "title": "cloudflare workers",
      "author": null,
      "publishedAt": null,
      "media": [],
      "attributes": {}
    }
  ]
}

Behavior

  • Suggestions are ordered by estimated relevance and capped at ten.
  • Successful requests are cached for up to one hour. Identical cache hits are not billed and bypass upstream work.
  • Autocomplete uses the standard 60 requests per client per minute limit.
  • Language and country affect suggestion selection. Strict filtering cannot be disabled.
  • Use type=shopping for product queries, type=videos, type=news, type=images, type=places, or type=travel for airport and city matches. The default remains web search.
  • Suggestions and rankings can change, and a partial query may return an empty feed.