fetch
Retrieve the full HTML content of a Wikipedia page using its page ID and language code. Provides direct access to the article's text.
Instructions
Fetch the content of a Wikipedia page by its ID in a specified language.
This function retrieves the full HTML content of a Wikipedia page by its page ID. It uses the MediaWiki API to fetch the content and returns it as a string. The content is normalized to ensure consistent Unicode representation.
:param id: The page ID of the Wikipedia article to fetch. :param language: The language of the Wikipedia article (e.g., 'en' for English). :return: The content of the article as a string, or None if not found.
:raises KeyError: If the 'parse' or 'text' keys are not present in the response. :raises httpx.HTTPStatusError: If the request fails or returns an error status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The page ID to fetch content for | |
| language | Yes | The language to fetch in |