Article title suggestions as the user types

Suggests article titles for a partial search, for search boxes.

Request

GEThttps://wikipedia-search.p.apihiver.com/v1/autocomplete?q=Bangal
*
String. Search text.
String. Wikipedia language code, e.g. en, hi, mr, ta (default en).
Number. Maximum number of results (1–20, default 10).
Language
Client
1curl --request GET \
2  --url 'https://wikipedia-search.p.apihiver.com/v1/autocomplete?q=Bangal&lang=%7Blang%7D&limit=%7Blimit%7D' \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY'

Article title suggestions as the user types: Wikipedia Search API reference

Suggests article titles for a partial search, for search boxes. This endpoint is part of the Wikipedia Search API: Search Wikipedia in 300+ languages, get article summaries with images, 'on this day' events, random articles and autocomplete.

Example response (200, application/json)

Success.

1{
2  "query": "Bangal",
3  "suggestions": [
4    {
5      "url": "https://en.wikipedia.org/wiki/Bangal",
6      "title": "Bangal"
7    },
8    {
9      "url": "https://en.wikipedia.org/wiki/Bangladesh",
10      "title": "Bangladesh"
11    },
12    {
13      "url": "https://en.wikipedia.org/wiki/Bangladesh_Liberation_War",
14      "title": "Bangladesh Liberation War"
15    }
16  ]
17}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "q: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.