0

I would like to retrieve only the events in a hash from February 14 wiki page

For that I am trying this JSON API call but it does not give clear information. How can I imrovise my api call to get all events list in a proper way. I would like to store this info in db as object like key, value pair.

Sam
  • 5,040
  • 12
  • 43
  • 95

1 Answers1

1

Use parameters prop=revisions, rvprop=content and set rvsection ID to the API call. In your case, the section ID for Events is 1, so the API call will be:

https://en.wikipedia.org/w/api.php?action=query&titles=February_14&prop=revisions&rvprop=content&format=json&rvsection=1

putu
  • 6,218
  • 1
  • 21
  • 30
  • I can not store the information as it is in the db. IS there any possible way to get proper information by removing the brackets and ASCII characters? – Sam Jun 09 '17 at 04:21
  • @Jefferson what programming language are you using to retrieve the content and to storing it to a database? There are [several parsers](https://www.mediawiki.org/wiki/Alternative_parsers) which can be used to extract text from mediawiki format. – putu Jun 09 '17 at 04:54
  • I am using node.js – Sam Jun 09 '17 at 06:54