4

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!

Termininja
  • 6,620
  • 12
  • 48
  • 49
Leslie G
  • 309
  • 2
  • 10

2 Answers2

5

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.

straycat
  • 103
  • 5
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
0

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

Mill
  • 110
  • 6