# Wikipedia



The encyclopedia's machine face — search articles by keyword, read any title's lead summary.



## Wikipedia Search

Articles by keyword, in any language edition — the search that finds the title the summary product reads.

- Method: `GET`
- Path: `/v1/wikipedia/search`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `q` | string | required | Search terms. |
| `lang` | string | optional | Language edition, e.g. `en` or `id`. |
| `limit` | integer | optional | 1 to 50 results. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/wikipedia/search \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "query": "quantum",
    "language": "en",
    "results": [
      {
        "title": "Quantum",
        "excerpt": "In physics, a quantum is the minimum amount of any physical entity involved in an interaction.",
        "description": "concept in physics",
        "url": "https://en.wikipedia.org/wiki/Quantum"
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-22T04:05:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-23T04:05:00.000Z"
  }
}
```

## Wikipedia Summary

The card a search engine shows — Wikipedia's lead paragraph, short description, lead image, and coordinates for any page title, in any language edition.

- Method: `GET`
- Path: `/v1/wikipedia/{title}`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `title` | path segment | required | The page title as the URL spells it, e.g. `Indonesia`. Spaces work as underscores do. |
| `lang` | string | optional | Language edition: `en`, `id`, `jv`, ... |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/wikipedia/%7Btitle%7D \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "title": "Indonesia",
    "language": "en",
    "description": "Country in Southeast Asia and Oceania",
    "extract": "Indonesia, officially the Republic of Indonesia, is a country in Southeast Asia and Oceania, between the Indian and Pacific oceans. It comprises about 17,000 islands, including Sumatra, Java, Sulawesi, and parts of Borneo and New Guinea.",
    "page_url": "https://en.wikipedia.org/wiki/Indonesia",
    "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Flag_of_Indonesia.svg/960px-Flag_of_Indonesia.svg.png",
    "coordinates": { "lat": -5, "lon": 120 },
    "page_id": 14579,
    "revision": 1369956402
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T04:05:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-21T04:05:00.000Z"
  }
}
```