rev. 334
services/apiref
services/apisrv
services/caches
services/caches/formatters
services/caches/search
services/caches/shortcuts
services/logs
services/oauth
services/replicate
services/users

Retrieve geocaches in GPX format
:: services/caches/formatters/gpx method

Minimum Authentication: Level 1 (see Authentication Levels)
http://www.opencaching.us/okapi/services/caches/formatters/gpx

Produces a standards-compliant Geocaching GPX file.

Unlike the services/caches/geocaches method responses, GPX files cannot contain names and descriptions in separate multiple languages. This method will attempt to choose the best language based on your preference (see langpref argument).

Remember that a full-blown GPX file is much larger than a basic one. This method can produce many various types of GPX files. The simplest list of waypoints takes ~50 times less space than the same list with cache descriptions and log entries included.

cache_codes required

Pipe-separated list of cache codes which you are interested in. No more than 500 codes are allowed. This CAN be an empty string (it will result in an empty, but valid, GPX file). All invalid cache codes will be skipped without any notice!

langpref optional

Default value: en

Pipe-separated list of ISO 639-1 language codes. This indicates the order of preference in which language will be chosen for GPX entities.

ns_ground optional

Default value: false

Boolean. If true then response will include Groundspeak's GPX extension. This namespace declares an extra <cache> element used by geocaching.com and many others. This namespace was initially associatied with geocaching.com, but now seems to be used in every geocaching GPX file. You probably want to have it.
ns_gsak optional

Default value: false

Boolean. If true then response will include GSAK GPX extension. This namespace declares an extra <wptExtension> element, which allows including "waypoint inheritance" information (parent-child relations). This in turn allows us to include "alternate waypoints" in the response.

We know of at least one tool that makes use of this.

ns_ox optional

Default value: false

Boolean. If true then response will include Garmin's OpenCaching.com GPX extension. This namespace declares an extra <opencaching> element used by Garmin's Opencaching.com. The element includes information on cache difficulty, ratings, tags and images. It is used within Garmin's Geocaching-enabled handheld GPS devices.
images optional

Default value: descrefs:nonspoilers

Which images to include (and how to include them). One of the following values:

  • none - no images will be included,
  • descrefs:nonspoilers - all non-spoiler images will be included as <img> references at the end of each cache description,
  • descrefs:all - all images will be included (including spoilers) as <img> references at the end of each cache description,
  • ox:all - all images will be included (including spoilers) as Garmin's <ox:image> references.

Note: When using "descrefs:" mode, remember to set ns_ground to true.

Note: When using "ox:" mode, remember to set ns_ox to true. You must also include JPEG files along the GPX for this to work properly - see services/caches/formatters/garmin for more information.

In the future, more generic ways of including images in GPX files may emerge.

attrs optional

Default value: desc:text

This argument controls wether cache attributes are included and how they are included. One of the following values:

  • none - no attributes will be included,
  • desc:text - attributes will be listed (in plain-text) within the cache description,
  • ox:tags - attributes will be converted to Garmin's ox:tag elements.

Note: When using "desc:" mode, remember to set ns_ground to true.

Note: When using "ox:" mode, remember to set ns_ox to true.

trackables optional

Default value: none

This argument controls wether information on trackables is included and how it is included. One of the following values:

  • none - no trackables-data will be included,
  • desc:list - trackables will be listed (in plain-text) within the cache description,
  • desc:count - total number of trackables will be included (in plain-text) within the cache description.

Note: When using "desc:" mode, remember to set ns_ground to true.

recommendations optional

Default value: none

This argument controls wether information on recommendations is included and how it is included. One of the following values:

  • none - no recommendations-info will be included,
  • desc:count - number of recommendations (and votes) will be included (in plain-text) within the cache description.

Note: When using "desc:" mode, remember to set ns_ground to true.

my_notes optional

Default value: none

Allows you to include personal user's notes on each cache. One of the following values:

  • none - don't include personal notes,
  • desc:text - include personal notes as part of the cache description.

Note: You need to use Level 3 Authentication in order to set it to anything else than "none".

latest_logs optional

Default value: false

Boolean. If true then response will include a couple of latest log entries for this cache (see also the lpc argument).

You must set ns_ground argument to true if you want to use this.

lpc optional

Default value: 10

Log-entries per cache - the number of log entries included in each returned cache. This should be an integer or a special "all" value. Please note, that the ns_ground and latest_logs arguments must be set to true in order for the logs to be included.
alt_wpts optional

Default value: false

Boolean. If true then we will include additional (alternate) waypoints in the response. These are all places associated with the cache.

Combine this with ns_gsak if you want the result to include additional references between waypoints and their geocaches. Please note that not many applications are currently able to properly understand GSAK metadata.

mark_found optional

Default value: false

Boolean. If true then all caches which are already found, will be marked appropriately (i.e. with an "found cache" symbol).

This field requires you to use the user_uuid parameter (or Level 3 Authentication).

user_uuid optional

User'd ID. Required to mark found caches using Level 1 Authentication.

If you use Level 3 Authentication, you shouldn't use this parameter. Or, to be exact:

  • user_uuid will be extracted from the Access Token you use. You don't have to provide it.
  • If you provide user_uuid, then it HAS TO match your Access Token. If it doesn't, OKAPI will respond with HTTP 400 error.
Plus required consumer_key argument, assigned for your application.

Returned value:

GPX file. All invalid cache codes will be skipped without any notice!