Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APIWikipedia

    wikipedia.page

    A Wikipedia article in any language: its text by section, description, categories, lead image, coordinates and Wikidata id.

    Id
    wikipedia.page
    Version
    1
    Billed per
    request — 1 unit for a charged run
    Runs
    within one request

    Start it with POST /v1/scrapers/wikipedia.page/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.

    Inputs

    The fields of input. A field that is not listed here is refused.

    Inputs of wikipedia.page
    FieldTypeDescription
    titlestringThe article's title, e.g. Ada Lovelace. A title Wikipedia redirects is followed.Limit: at least 1 characters, at most 255 characters.
    urlstringThe article's address instead, e.g. https://en.wikipedia.org/wiki/Ada_Lovelace. Its language is the address's own.Limit: at most 2048 characters.
    languagestringThe language edition, as Wikipedia's code for it: en (the default), de, ja, simple. With url it may only repeat the address's own.Limit: at most 30 characters.

    Record fields

    Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.

    Record fields of wikipedia.page
    FieldTypeNotes
    page_idintegerWikipedia's id of the article in this language edition.
    titlestringThe article's title.
    urlstringThe article's address.
    languagestringThe language edition the article is from, e.g. en.
    descriptionstring or nullThe one-line description Wikipedia shows under the title, e.g. English mathematician (1815–1852). Null where the article has none.
    summarystring or nullThe article's introduction: its text before the first section heading.
    textstring or nullThe whole article as plain text, section headings written as == Heading ==. Tables, infoboxes and reference lists are not part of it.
    sectionsarray of objectThe article's sections in order, each with its own text. The introduction is summary, not a section.
    title (in sections[])stringThe section's heading.
    level (in sections[])integerThe heading's depth: 2 for a section, 3 for a subsection, and so on.
    text (in sections[])stringThe section's own text, without its heading and without its subsections' text. Empty for a section that only holds subsections.
    categoriesarray of stringThe categories the article is in, without Wikipedia's maintenance categories.
    imagestring or nullThe address of the article's lead image at full size. Null where the article has none.
    image_widthinteger or nullThe width of that image in pixels.
    image_heightinteger or nullThe height of that image in pixels.
    latitudenumber or nullThe latitude of the place the article is about, in decimal degrees. Null for an article that is not about a place.
    longitudenumber or nullThe longitude of that place.
    wikidata_idstring or nullThe id of the article's subject in Wikidata, e.g. Q7259.
    is_disambiguationbooleanTrue when the page lists the articles a name can mean instead of being an article itself.
    redirected_fromstring or nullThe title that was asked for, when Wikipedia led from it to this article (UK leads to United Kingdom). Null otherwise.
    last_edited_atstring (date-time) or nullWhen the article was last edited, in UTC.
    revision_idinteger or nullThe id of the article's current revision.
    length_bytesinteger or nullThe size of the article's source in bytes.
    fetched_atstring (date-time)When the article was read, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    curl -X POST "https://api.enrichednow.com/v1/scrapers/wikipedia.page/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"title":"Ada Lovelace"}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("wikipedia.page", {"title": "Ada Lovelace"})
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("wikipedia.page", { title: "Ada Lovelace" });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "wikipedia.page", map[string]any{"title": "Ada Lovelace"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("wikipedia.page", Map.of("title", "Ada Lovelace"));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run wikipedia.page --input 'title=Ada Lovelace'

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "input": {
        "title": "Ada Lovelace"
      }
    }

    Example response

    The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.

    JSON
    {
      "id": "run_841742f37553189ff9c27ba1",
      "scraper_id": "wikipedia.page",
      "scraper_version": 1,
      "status": "ok",
      "reason": null,
      "input": {
        "title": "Ada Lovelace"
      },
      "record_count": 1,
      "units": 1,
      "units_per_request": 1,
      "units_per_record": null,
      "units_per_page": null,
      "diagnostics": {
        "requests": 1,
        "bytes": 259214,
        "wall_ms": 885,
        "facts": {}
      },
      "created_at": "2026-11-16T22:37:50.170950Z",
      "started_at": "2026-11-16T22:37:50.178331Z",
      "finished_at": "2026-11-16T22:37:51.066313Z"
    }

    Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.

    JSON
    {
      "records": [
        {
          "page_id": 974,
          "title": "Ada Lovelace",
          "url": "https://en.wikipedia.org/wiki/Ada_Lovelace",
          "language": "en",
          "description": "English mathematician (1815–1852)",
          "summary": "Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852), also known as Ada Lovelace, was an English mathematician and writer chiefly known for work on Charles Babbage's proposed mechanical general-purpose … [truncated]",
          "text": "Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852), also known as Ada Lovelace, was an English mathematician and writer chiefly known for work on Charles Babbage's proposed mechanical general-purpose … [truncated]",
          "sections": [
            {
              "title": "Biography",
              "level": 2,
              "text": ""
            },
            {
              "title": "Childhood",
              "level": 3,
              "text": "Lord Byron expected his child to be a \"glorious boy\" and was disappointed when Lady Byron gave birth to a girl. The child was named after Byron's half-sister, Augusta Leigh, and was called \"Ada\" by Byron himself. On 16 January 1816, at Lord … [truncated]"
            }
          ],
          "categories": [
            "1815 births",
            "1852 deaths",
            "19th-century British women mathematicians"
          ],
          "image": "https://upload.wikimedia.org/wikipedia/commons/4/4c/Ada_Lovelace_daguerreotype_by_Antoine_Claudet_1843_-_cropped.png",
          "image_width": 957,
          "image_height": 1239,
          "latitude": null,
          "longitude": null,
          "wikidata_id": "Q7259",
          "is_disambiguation": false,
          "redirected_from": null,
          "last_edited_at": "2026-11-18T12:08:56Z",
          "revision_id": 1386418140,
          "length_bytes": 98431,
          "fetched_at": "2026-11-19T18:07:42.674158Z"
        }
      ],
      "next_cursor": null
    }

    What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].

    • Shortened: summary: 3,186 characters, the first 236 shown.
    • Shortened: text: 40,824 characters, the first 236 shown.
    • Shortened: sections: 29 items, the first 2 shown.
    • Shortened: sections[1].text: 3,981 characters, the first 240 shown.
    • Shortened: categories: 30 items, the first 3 shown.

    A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Wikipedia scrapers are in their own section there.