BCaching API


This topic is no longer up to date. The latest API documentation can be found here on the forums.

The bcaching API is intended for use by mobile geocaching apps to retrieve geocache data and have access to a large repository of geocache data without needing to store it all on the device itself. Response data for all requests except for “login” is in the standard GPX format. All query results are restricted to those that are accessible by the authenticated user.

Request format is
http://(www|test).bcaching.com/api/q.ashx?u=<username>&REQUEST&time=<current-time>&sig=<signature>
where:

  • username is a valid bcaching.com username
  • current-time is the current mobile device time in “java” milliseconds (i.e. java.util.Date.getTime) or equivalent
  • signature is an md5 hash of the querystring plus an md5 hash of the bcaching user’s password.

{{REQUEST}} can be one of the following:

  • Verify login only: a=login
    Does nothing more than return success or failure based on the validation of the username password/hashword.
  • Find nearest caches (Summary): a=find&lat=<latitude>&lon=<longitude>&find=<find>&maxdistance=<max-distance>&maxcount=<max-count>
    Returns summary-only gpx data — with no short or long descriptions, extra waypoints, logs, etc.

     

    • latitude is the latitude in signed degree decimal form i.e. 40.123456
    • longitude is the longitude in signed degree decimal form i.e. -74.987654
    • find is a URL-encoded string to search for caches by waypoint# (with or without the GC prefix) or partial name match.
    • max-distance is optional and specifies the maximum distance in degrees. Default is 0.3 – about 30 miles
    • max-count is optional and specifies the maximum number of nearest caches to return in the gpx data. Default is 50.
  • Get cache detail: a=detail&ids=<cache-id-list>&desc=<description-mode>&wpts=<wpts>&logs=<logs>&tbs=<tbs>
    Returns detailed gpx data for one or more caches

     

    • cache-id-list is a comma-separated list of cache ids (not waypoint numbers). Cache ids are included in the summary gpx request.
    • description-mode indicates what form to send the description and can be one of the following:
      • none: neither short nor long description is included
      • short: short description is included, converted to text if was html
      • long: short and long description are included, converted to text they were html
      • html: full original short and long descriptions are included
    • wpts is a flag indicating whether or not additional waypoints should be included: 0 = no waypoints (default), 1 = include waypoints
    • logs is the maximum number of logs to include: 0 = none (default), 1 or more indicates the maximum number
    • tbs is a flag indicating whether or not cache inventory should be included: 0 = no waypoints (default), 1 = include TBs
  • Get nearest caches (Detail): a=nearest&maxcount=<max-count>&desc=<description-mode>&wpts=<wpts>&logs=<logs>&tbs=<tbs>
    • max-count is optional and specifies the maximum number of nearest caches to return in the gpx data. Default is 30.
    • all other parameters (desc, wpts, logs, tbs) are identical to Get cache detail section.
Advertisements

1 comment so far

  1. […] The Query API can be found here. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: