API to get Wikipedia revision id by date [closed]

2019-02-18 16:48发布

Is there any API to get wikipedia revision id by date, instead of checking all the revision history and extract out the most recent revision before that date?

Thank you!

2条回答
够拽才男人
2楼-- · 2019-02-18 17:00

Building on the previous answer: The always accepted format yyyymmddhhmmss returned errors. This example returned a valid response:

JSON

XML

The id in field revid contains the id previous to the date passed in param rvstart:

Revision id

查看更多
可以哭但决不认输i
3楼-- · 2019-02-18 17:24

The revision query api allows you to pass timestamps to get only revisions from a specified interval. Use

api.php?action=query&prop=revisions&rvlimit=1&rvstart= myTimestamp

Check out the Manual:WfTimestamp for accepted formats - yyyymmddhhmmss always works.

查看更多
登录 后发表回答