---
title: "Wikipedia API: article search, article content as JSON"
description: "Wikipedia API for article search and article content as JSON in 12 languages, with snippets, word counts and edit dates. 1 credit per successful call."
url: https://perceptlayer.com/apis/wikipedia
---

[APIs](https://perceptlayer.com/apis) / [Apps and media](https://perceptlayer.com/verticals/apps) / Wikipedia

1 credit per call 2 endpoints 8 datapoints 

# Wikipedia API

Wikipedia API for article search and article content as JSON in 12 languages, with snippets, word counts and edit dates. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

Wikipedia

GET /v1/wikipedia/search?q=Albert+Einstein&language=en 

```
{
  "success": true,
  "data": {
    "search_parameters": {
      "q": "Albert Einstein",
      "language": "en"
    },
    "total_hits": 7560,
    "page": 1,
    "per_page": 20,
    "has_more": true,
    "results": [
      {
        "title": "Albert Einstein",
        "page_id": 736,
        "url": "https://en.wikipedia.org/wiki/Albert_Einstein",
        "size_bytes": 240550,
        "word_count": 24016,
        "snippet": "Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity. Einstein also",
        "snippet_html": "<span class=\"searchmatch\">Albert</span> <span class=\"searchmatch\">Einstein</span> (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity. <span class=\"searchmatch\">Einstein…",
        "updated_at": "2026-11-09T12:38:29Z"
      },
      {
        "title": "Hans Albert Einstein",
        "page_id": 1373258,
        "url": "https://en.wikipedia.org/wiki/Hans_Albert_Einstein",
        "size_bytes": 14413,
        "word_count": 1222,
        "snippet": "Hans Albert Einstein (May 14, 1904 – July 26, 1973) was a Swiss-American engineer, the second child and first son of physicists Albert Einstein and Mileva",
        "snippet_html": "Hans <span class=\"searchmatch\">Albert</span> <span class=\"searchmatch\">Einstein</span> (May 14, 1904 – July 26, 1973) was a Swiss-American engineer, the second child and first son of physicists <span class=\"searchmatch\">Albert</span> <span …",
        "updated_at": "2026-09-01T00:57:53Z"
      },
      {
        "title": "Einstein family",
        "page_id": 18742711,
        "url": "https://en.wikipedia.org/wiki/Einstein_family",
        "size_bytes": 33129,
        "word_count": 3522,
        "snippet": "The Einstein family is the family of physicist Albert Einstein (1879–1955). Einstein's fourth-great-grandfather, Jakob Weil, was his oldest recorded relative",
        "snippet_html": "The <span class=\"searchmatch\">Einstein</span> family is the family of physicist <span class=\"searchmatch\">Albert</span> <span class=\"searchmatch\">Einstein</span> (1879–1955). <span class=\"searchmatch\">Einstein&#039;s</span> fourth-great-gra…",
        "updated_at": "2026-11-08T17:16:17Z"
      }
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "request_id": "req_84b4048f2c8d48f2b88a39e61725f737",
    "credits_charged": 1,
    "credits_remaining": 1775
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | title string | page\_id integer | url url | size\_bytes integer | word\_count integer | snippet string | snippet\_html string | updated\_at string |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Albert Einstein | 736 | https://en.wikipedia.org/wiki/Albert\_Einstein | 240550 | 24016 | Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity. Einstein also | <span class="searchmatch">Albert</span> <span class="searchmatch">Einstein</span> (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity. <span class="searchmatch">Einstein… | 2026-11-09T12:38:29Z |
| 2 | Hans Albert Einstein | 1373258 | https://en.wikipedia.org/wiki/Hans\_Albert\_Einstein | 14413 | 1222 | Hans Albert Einstein (May 14, 1904 – July 26, 1973) was a Swiss-American engineer, the second child and first son of physicists Albert Einstein and Mileva | Hans <span class="searchmatch">Albert</span> <span class="searchmatch">Einstein</span> (May 14, 1904 – July 26, 1973) was a Swiss-American engineer, the second child and first son of physicists <span class="searchmatch">Albert</span> <span … | 2026-09-01T00:57:53Z |
| 3 | Einstein family | 18742711 | https://en.wikipedia.org/wiki/Einstein\_family | 33129 | 3522 | The Einstein family is the family of physicist Albert Einstein (1879–1955). Einstein's fourth-great-grandfather, Jakob Weil, was his oldest recorded relative | The <span class="searchmatch">Einstein</span> family is the family of physicist <span class="searchmatch">Albert</span> <span class="searchmatch">Einstein</span> (1879–1955). <span class="searchmatch">Einstein&#039;s</span> fourth-great-gra… | 2026-11-08T17:16:17Z |

Recorded from our API · 3 items shown · 8 datapoints per item GET /v1/wikipedia/search?q=Albert+Einstein&language=en

8 datapoints

### Identity

-   title string
-   page\_id integer

### Contact

-   url url

### Other

-   size\_bytes integer
-   word\_count integer
-   snippet string
-   snippet\_html string
-   updated\_at string

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/wikipedia/search?q=Albert+Einstein&language=en" \
  -H "X-API-Key: $API_KEY"
```

Wikipedia · 2 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/wikipedia/article`](https://perceptlayer.com/apis/wikipedia/article) | `title` +1 optional | JSON | 1 credit |
| [GET `/v1/wikipedia/search`](https://perceptlayer.com/apis/wikipedia/search) | `q` +3 optional | `title` `page_id` `url` `size_bytes` `word_count` `snippet` +2 more | 1 credit |

Overview

## About the Wikipedia API

## What you can get

The Wikipedia API returns Wikipedia search results and articles as JSON through 2 endpoints. Both take a `language` of en, de, fr, es, it, pt, nl, ja, ru, pl, sv or zh.

-   **Search:** `search` takes a `q`, with `language`, `page` and `per_page`.
-   **Articles:** `article` takes a `title`, with `language`.

The recorded search for "Albert Einstein" in English returns `results`, each with `title`, `page_id`, `url`, `size_bytes`, `word_count`, `snippet`, `snippet_html` and `updated_at`. It also returns `search_parameters`, `total_hits`, `page`, `per_page` and `has_more`.

## How a call works

Search, then read: `GET /v1/wikipedia/search?q=Albert Einstein&language=en`, with your key in the `X-API-Key` header, returns each article's `title`. Pass a title to `article`, for example `GET /v1/wikipedia/article?title=Albert Einstein&language=en`. Check `has_more` before asking for the next `page`. Every successful call costs 1 credit; failed calls cost nothing.

Apps and media JSON REST MCP

### More apps and media APIs

[Apple App Store](https://perceptlayer.com/apis/apple-app-store) [Apple Podcasts](https://perceptlayer.com/apis/apple-podcasts) [arXiv](https://perceptlayer.com/apis/arxiv) [Audible](https://perceptlayer.com/apis/audible) [Bandcamp](https://perceptlayer.com/apis/bandcamp) [Chrome Web Store](https://perceptlayer.com/apis/chrome-web-store) [CISA KEV](https://perceptlayer.com/apis/cisa-kev) [ClinicalTrials.gov](https://perceptlayer.com/apis/clinicaltrials) [Coursera](https://perceptlayer.com/apis/coursera) [crates.io](https://perceptlayer.com/apis/crates-io) [Crossref](https://perceptlayer.com/apis/crossref) [Discogs](https://perceptlayer.com/apis/discogs)

Use cases

### Ground an agent's answers in a Wikipedia article

`Use the Wikipedia API to ground an agent's answers in a Wikipedia article` 

### Find articles on a topic in one of 12 languages

`Use the Wikipedia API to find articles on a topic in one of 12 languages` 

### Compare how an article is covered across language editions

`Use the Wikipedia API to compare how an article is covered across language editions` 

### Build entity pages from article titles, snippets and links

`Use the Wikipedia API to build entity pages from article titles, snippets and links` 

FAQ

## Questions

**How much does the Wikipedia API cost?**

Each successful call costs one credit, and each search page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**Which languages are supported?**

Pass \`language\` as en, de, fr, es, it, pt, nl, ja, ru, pl, sv or zh to \`search\` or \`article\`.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Is this the official Wikipedia API?**

No. Perceptlayer is an independent service and is not affiliated with Wikipedia. It returns Wikipedia data as JSON with a Perceptlayer key, so there is no Wikipedia developer account, app review or partner approval to get first. It only reads data: if Wikipedia has an official API and you need to act on your own Wikipedia account, such as posting, managing orders or reading private data, use that one.

**Should I build a Wikipedia scraper instead?**

You can, but a Wikipedia scraper is code you maintain: page changes break it, requests get blocked, and Wikipedia's terms govern how you collect data. The Wikipedia API gives you 2 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the Wikipedia API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
