Concepts

REST API

The OpenCaching.com API is offered through a REST interface.  You can use your browser to access URLs, and you can use pretty much any HTTP client in any programming language to interact with the API.

Resources

REST stands for REpresentational State Transfer.  Following the REST architecture means that all the public data OpenCaching.com has about geocaches, log, users, etc. as well as methods to find groups of geocaches, logs, users, etc. are available on the internet through a unique resource identifier (a URI or URL). These resources make up the OpenCaching.com API. You can access these resources just like you would any other resource on the internet, by calling its URL and specifying parameters for that URL.

For example:
To get information about a geocache with OX code OXERF4R, call http://www.opencaching.com/api/geocache/OXERF4R/.
To get information about a user with id 98428 call http://www.opencaching.com/api/user/98428/. To find all the geocaches in an area call http://www.opencaching.com/api/geocache?bbox=48,234,-94.549, 48,477,-94.778.

This documentation details where all of these resources are located and what parameters you can pass to them to control what information you receive.

Standard HTTP

Using a rest interface means that the OpenCaching.com API is accessible through standard HTTP requests. No additional wrapping or meta data is required.

Since web browsers already use HTTP, requesting data from the API can be tested by pasting the request into the browser's address bar and looking at the result in the browser.

Using standard HTTP also eliminates many problems that are caused by firewalls.

Methods

HTTP supports several different types of methods when making a request. The OpenCaching.com API takes different actions depending on which method is used.

GET requests should be made when you want to fetch or read information from the OpenCaching.com database.

POST requests should be made when you want to add a new object to the OpenCaching.com database or modify existing data.