Wikipedia

Search Wikipedia by keyword and read up to 100 pages by title in one call, with opening text, short description and Wikidata id, as typed JSON.

Embed
Preview of the card
<a href="https://scrapelyserp.com/docs/wikipedia"><img src="https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/pages/35893376-3585-4520-b555-ca3234ddf891/social-card.svg?v=3e7ae33eec8b" alt="Wikipedia" width="600" height="315"></a>

Search Wikipedia by keyword and read up to 100 pages by title in one call, with opening text, short description and Wikidata id, as typed JSON.

At a glance

Two GET endpoints under /v1/structured/wikipedia/, for the 16 language editions in en, de, fr, es, it, pt, nl, pl, sv, ru, ja, zh, ar, ko, tr, uk (lang, default en; any other value is a free 400). Each answers { endpoint, url, credits, duration_ms, data }. Each call is charged for the data it moves, and a call we could not read is 502 TARGET_FAILED and costs nothing. Rates are estimates until production traffic measures them.

Endpoint

What

Typical

GET /v1/structured/wikipedia/search

Pages matching query, best match first

about 5 million results per credit, up to 50 per call

GET /v1/structured/wikipedia/pages

Pages by titles, up to 100 per call

about 1 million pages per credit

curl -G "https://api.scrapelyserp.com/v1/structured/wikipedia/pages" \
  -H "Authorization: Bearer $SCRAPELY_API_KEY" \
  --data-urlencode "titles=Albert Einstein|Web scraping"

Parameter

Type

Default

Description

query (required)

string

—

The search terms.

lang

enum

en

The language edition.

limit

integer

20

Results per page, 1–50.

cursor

string

—

The next_cursor of the previous page.

Each result has title, page_id, url, snippet (plain text around the match), word_count and last_modified; total counts every match. A query that matches nothing is an empty results with a total of 0. next_cursor is null at the end.

Full reference → GET /v1/structured/wikipedia/search

Pages by title

Parameter

Type

Default

Description

titles (required)

string

—

Page titles separated by |, e.g. Albert Einstein|Web scraping; page links work too. Up to 100.

lang

enum

en

The language edition.

data.pages are in the order you asked, one for each title: requested is the title as you sent it and title the page's own, because a title is tidied (albert einstein becomes Albert einstein) and redirects are followed (Einstein is the page Albert Einstein, with redirected_from set). Two titles that lead to one page give two entries. Each page has page_id, url, description (Wikipedia's one-line description), extract (the opening section as plain text), wikidata_id, disambiguation (true for a page that lists several meanings, such as Mercury), last_modified and length. A title that is not a page comes back in data.not_found, and a call where none is a page is a free 404 NOT_FOUND.

Full reference → GET /v1/structured/wikipedia/pages

Updated