1,554
edits
(add Elasticsearch section) |
(add note about json.tool and json_pp) |
||
Line 1: | Line 1: | ||
[[ | See [[IDigBio API]] for full documentation on the API including all of the available endpoints. | ||
For best sampling of JSON results in a browser, you may wish to use the JSONView Extension for Chrome and Firefox. | |||
In most cases for these examples we format the output of the JSON document using a "pretty printing" feature of some kind in order to make this document more readable by humans. | |||
For example, this is the raw JSON returned by the base URL of the api: | |||
<pre> | |||
$ curl -s http://api.idigbio.org/ | |||
{"v1":"http://api.idigbio.org/v1/","v0":"http://api.idigbio.org/v0/","check":"http://api.idigbio.org/check"} | |||
</pre> | |||
We make this easier to read by a human if we pipe the output through a formatter such as python's json.tool or the json_pp command-line Perl script (JSON::PP). | |||
==== json.tool Example ==== | |||
<pre> | |||
$ curl -s http://api.idigbio.org/ | python -m json.tool | |||
{ | |||
"check": "http://api.idigbio.org/check", | |||
"v0": "http://api.idigbio.org/v0/", | |||
"v1": "http://api.idigbio.org/v1/" | |||
} | |||
</pre> | |||
==== json_pp Example ==== | |||
<pre> | |||
$ curl -s http://api.idigbio.org/ | json_pp | |||
{ | |||
"v1" : "http://api.idigbio.org/v1/", | |||
"check" : "http://api.idigbio.org/check", | |||
"v0" : "http://api.idigbio.org/v0/" | |||
} | |||
</pre> | |||
==== JSONView Browser Extension Example ==== | |||
Here goes a screenshot. | |||
=== Fetch A Single Record from the API === | === Fetch A Single Record from the API === | ||
Line 156: | Line 184: | ||
See also [[iDigBio API Performance]]. | See also [[iDigBio API Performance]]. | ||
[[Category:CYWG]] | |||
[[Category:API]] | |||
[[Category:Documentation]] |
edits