API

维基数据 API

维基数据是一个共同维护的知识库,拥有超过1.21亿个项目,涵盖人员、组织、地点、作品和概念。它对于实体解析、知识图谱、搜索增强和结构化研究非常重要。

API 参考 版本: 1.0.0 10 终端 身份验证
维基数据实体

基本网址

https://api.pressmonitor.com

身份验证

所有请求使用 Bearer 令牌身份验证。每个调用都添加授权头。

Authorization: Bearer YOUR_API_KEY
x-subscription-id: YOUR_SUB_ID
GET /suggest-entities

建议实体

参数

名称 类型 位置 必填 描述
query_text string query 查询文本
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/suggest-entities?query_text=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /search/by-label

按标签搜索实体

参数

名称 类型 位置 必填 描述
query_text string query 查询文本
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/search/by-label?query_text=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /search/by-description

按描述搜索实体

参数

名称 类型 位置 必填 描述
query_text string query 查询文本
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/search/by-description?query_text=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /search/by-type

按类型搜索实体

参数

名称 类型 位置 必填 描述
type string query 类型
query_text string query 查询文本
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/search/by-type?type=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /search/by-claim

按声明值搜索实体

参数

名称 类型 位置 必填 描述
property string query 属性
value string query
mode string query 模式
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/search/by-claim?property=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /find/by-property

按属性搜索实体

参数

名称 类型 位置 必填 描述
property string query 属性
value string query
qualifier string query 限定符
rank string query 等级
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/find/by-property?property=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /search/temporal

按日期范围搜索实体

参数

名称 类型 位置 必填 描述
property string query 属性
from string query 起始
to string query 终止
value string query
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/search/temporal?property=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /entities/$0

通过ID获取实体

参数

名称 类型 位置 必填 描述
wikidata_id string query 维基数据ID
lang string query 语言

代码示例

curl -X GET "https://api.pressmonitor.com/entities/$0?wikidata_id=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /entities/$0/claims

获取实体声明

参数

名称 类型 位置 必填 描述
wikidata_id string query 维基数据ID
lang string query 语言
limit string query 限制
offset string query 偏移量

代码示例

curl -X GET "https://api.pressmonitor.com/entities/$0/claims?wikidata_id=VALUE" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功
GET /properties

获取属性

代码示例

curl -X GET "https://api.pressmonitor.com/properties" -H "Authorization: Bearer YOUR_API_KEY" -H "x-subscription-id: YOUR_SUB_ID"

响应

200 成功