# Wikipedia Article

Returns one Wikipedia article: page id, title, canonical URL, short description, Wikidata id, disambiguation flag, summary, the full plain text, sections, infobox as label and value pairs (empty when the article has none; some languages keep these facts elsewhere), internal links, images with file URLs, external links, categories and language links. Redirects are followed and reported in redirected_from. Missing articles answer 404. Languages: en, de, fr, es, it, pt, nl, ja, ru, pl, sv and zh. Costs 1 credit per successful request.

- **Documentation:** [https://scrappa.co/docs/wikipedia-api/wikipedia_article](https://scrappa.co/docs/wikipedia-api/wikipedia_article)
- **API group:** Wikipedia API
- **Endpoint:** `GET https://scrappa.co/api/wikipedia/article`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `title` | string | Yes | Article title, e.g. Albert Einstein. Redirects are followed. |
| `language` | string | No | Wikipedia language code: en, de, fr, es, it, pt, nl, ja, ru, pl, sv or zh. Defaults to en. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/wikipedia/article?title=Albert+Einstein&language=en"
```

## Example response

```json
{
    "success": true,
    "data": {
        "page_id": 736,
        "title": "Albert Einstein",
        "display_title": "Albert Einstein",
        "url": "https://en.wikipedia.org/wiki/Albert_Einstein",
        "language": "en",
        "description": "German-born theoretical physicist (1879\u20131955)",
        "wikidata_id": "Q937",
        "is_disambiguation": false,
        "text": "...",
        "sections": [
            {
                "index": 1,
                "level": 2,
                "number": "1",
                "title": "Life and career",
                "anchor": "Life_and_career"
            },
            {
                "index": 2,
                "level": 3,
                "number": "1.1",
                "title": "Childhood, youth and education",
                "anchor": "Childhood,_youth_and_education"
            }
        ],
        "infobox": [
            {
                "label": "Born",
                "value": "(1879-03-14)14 March 1879, Ulm, Kingdom of W\u00fcrttemberg, German Empire"
            },
            {
                "label": "Died",
                "value": "18 April 1955(1955-04-18) (aged 76), Princeton, New Jersey, U.S."
            }
        ],
        "links": [
            {
                "title": "Einstein (disambiguation)",
                "url": "https://en.wikipedia.org/wiki/Einstein_%28disambiguation%29"
            },
            {
                "title": "Albert Einstein (disambiguation)",
                "url": "https://en.wikipedia.org/wiki/Albert_Einstein_%28disambiguation%29"
            }
        ],
        "images": [
            {
                "file": "Symbol support vote.svg",
                "url": "https://en.wikipedia.org/wiki/Special:FilePath/Symbol_support_vote.svg"
            },
            {
                "file": "Semi-protection-shackle.svg",
                "url": "https://en.wikipedia.org/wiki/Special:FilePath/Semi-protection-shackle.svg"
            }
        ],
        "external_links": [
            "https://doi.org/10.1098%2Frsbm.1955.0005",
            "https://www.jstor.org/stable/769242"
        ],
        "categories": [],
        "language_links": [
            {
                "language": "ab",
                "name": "Abkhazian",
                "title": "\u0415\u0438\u043d\u0448\u0442\u0435\u0438\u043d, \u0410\u043b\u0431\u0435\u0440\u0442",
                "url": "https://ab.wikipedia.org/wiki/%D0%95%D0%B8%D0%BD%D1%88%D1%82%D0%B5%D0%B8%D0%BD,_%D0%90%D0%BB%D0%B1%D0%B5%D1%80%D1%82"
            },
            {
                "language": "af",
                "name": "Afrikaans",
                "title": "Albert Einstein",
                "url": "https://af.wikipedia.org/wiki/Albert_Einstein"
            }
        ]
    },
    "meta": {
        "endpoint_family": "article",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Upstream Unavailable | The source could not be fetched after the attempt budget. Never charged. Safe to retry. |
| 500 | Parser Drift | The source returned a shape this parser does not recognise. The incident is reported. Never charged. |
| 404 | Not Found | The source has no such public resource. Never charged. |
| 422 | Invalid Parameter | A value in this request is invalid or the requested page is out of range. Never charged. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
