# Wikipedia Article Wikidata ID API

Get Wikipedia Article Wikidata ID data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Wikimedia, pass parameters such as action, format, formatversion, and retrieve structured data including wikipedia page identifier, resolved Wikipedia article title, and associated Wikidata item identifier to link references to entities, start structured enrichment, and resolve article redirects.

Documentation: https://openany.si/wikipedia/wikipedia-article-wikidata-id/
API ID: ecc15868-f889-4404-b2e5-c4337a01cd1f
Provider: wikimedia
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/wikimedia/wikidata-id
Page update time: 2026-12-03T02:37:02.897Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:37:02.897Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Wikipedia Article Wikidata ID API

Use prop=pageprops and ppprop=wikibase\_item for an English article title. With redirects=1, the resolved page record can include pageprops.wikibase\_item containing a Wikidata identifier.

## What You Can Build

- **Link references to entities**: Store the article identity and associated Wikidata ID.
- **Start structured enrichment**: Pass the ID to a separate Wikidata Entity Details request.
- **Resolve article redirects**: Use the resolved title when reconciling records.

## Returned Data

| Field | Meaning |
| --- | --- |
| `query.pages[].pageid` | Wikipedia page identifier |
| `query.pages[].title` | Resolved Wikipedia article title |
| `query.pages[].pageprops.wikibase_item` | Associated Wikidata item identifier |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Wikipedia Article Wikidata ID API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "Set to query.",
          "enum": [
            "query"
          ]
        },
        "prop": {
          "type": "string",
          "description": "Set to pageprops.",
          "enum": [
            "pageprops"
          ]
        },
        "ppprop": {
          "type": "string",
          "description": "Set to wikibase_item.",
          "enum": [
            "wikibase_item"
          ]
        },
        "titles": {
          "type": "string",
          "description": "English Wikipedia article title.",
          "minLength": 1,
          "maxLength": 255
        },
        "redirects": {
          "type": "string",
          "description": "Set to 1.",
          "enum": [
            "1"
          ]
        },
        "format": {
          "type": "string",
          "description": "Set to json.",
          "enum": [
            "json"
          ]
        },
        "formatversion": {
          "type": "string",
          "description": "Set to 2.",
          "enum": [
            "2"
          ]
        }
      },
      "required": [
        "action",
        "prop",
        "ppprop",
        "titles",
        "redirects",
        "format",
        "formatversion"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "batchcomplete": {
      "type": "boolean"
    },
    "query": {
      "type": "object",
      "properties": {
        "pages": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "ns": {
                "type": "integer"
              },
              "pageid": {
                "type": "integer"
              },
              "pageprops": {
                "type": "object",
                "properties": {
                  "wikibase_item": {
                    "type": "string"
                  }
                }
              },
              "title": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/wikimedia/wikidata-id?action=query&format=json&formatversion=2&ppprop=wikibase_item&prop=pageprops&redirects=1&titles=Earth' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "batchcomplete": true,
  "query": {
    "pages": [
      {
        "ns": 0,
        "pageid": 9228,
        "pageprops": {
          "wikibase_item": "Q2"
        },
        "title": "Earth"
      }
    ]
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Is a Wikipedia page ID the same as a Wikidata ID?
No. pageid identifies a Wikipedia page; wikibase_item identifies its associated Wikidata item, such as Q2.

### Does this return Wikidata claims or labels?
No. Use the returned item ID with a separate Wikidata Entity Details operation.

### What if wikibase_item is absent?
Treat the association as unavailable. Do not synthesize an entity ID from the page ID or title.

### Does this resolve redirects?
The contract requires redirects=1; inspect the returned resolved page title.

### Can I send a Chinese article title?
This operation describes English article titles. The Chinese-to-English Article Link API can help connect language editions first.

### Does the lookup create a Wikidata item?
No. It is a read-only lookup of an existing page association.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
