# Api in json or xml format

**URL:** <https://www.ruby-forum.com/t/api-in-json-or-xml-format/225292>\
**Category:** Ruby\
**Created:** [December 27, 2012, 5:15pm UTC](https://www.ruby-forum.com/t/api-in-json-or-xml-format/225292 "2012-12-27T17:15:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 27, 2012, 5:15pm UTC](https://www.ruby-forum.com/t/api-in-json-or-xml-format/225292/1 "2012-12-27T17:15:08Z")

</div>

Hi,

is there any API for historical dates on web that returns data in xml or  
json format. For example, I need to get importants events in history on  
todays day and show that events in my app.

Is there any good place to do it?

And if you know for some other useful API, you can also write it.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![aldm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@aldm](https://www.ruby-forum.com/u/aldm)\
**Post date:** [December 27, 2012, 6:04pm UTC](https://www.ruby-forum.com/t/api-in-json-or-xml-format/225292/2 "2012-12-27T18:04:52Z")

</div>

Wikipedia has a nice API that can return values in a variety of formats.  
You’ll have to process the wikitext yourself, though.

E.g. to return the text of the article about 27th of December, wrapped  
in a JSON structure:

> <https://en.wikipedia.org/w/api.php?action=query&prop=revisions&format=json&rvprop=content&rvlimit=1&titles=December%2027>
>
> {"continue":{"rvcontinue":"20230131064547|1136616305","continue":"||"},"warnings":{"main":{"\*":"Subscribe to the mediawiki-api-announce mailing list at for notice of API deprecations and breaking changes. Use \[\[Special:ApiFeatureUsage\]\] to see usage of deprecated features by your application."},"revisions":{"\*":"Because \\"rvslots\\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."}},"query":{"pages":...

You can view the API reference at [MediaWiki API help - Wikipedia](https://en.wikipedia.org/w/api.php) ,  
read more at [API - MediaWiki](https://www.mediawiki.org/wiki/API) , and play with it in  
your browser at [API sandbox - Wikipedia](https://en.wikipedia.org/wiki/Special:ApiSandbox) .
