Archive for the ‘geocaching api’ Tag

Offline and out of touch

We recently went to Vegas on vacation and during the trip spent several days at Red Rock Canyon. It was a beautiful spot and a lot of fun to explore.

Red Rock Canyon

We brought our usual geocaching setup — Garmin 60csx for navigation and bcaching.com on the Motorola Droid for paperless info and field notes. Verizon gives us pretty good coverage and we can usually access bcaching.com from almost anywhere, but we weren’t so lucky in the canyon where it was spotty at best. Usually we had no signal at all.

If you’re using Blackstar on the blackberry (one of the few apps to currently support the bcaching API to access your geocaching data and store it locally in the phone) it’s not a big deal because you can load the caches into the device when you have a signal then you’re good to go whether you have a signal or not.

But if you’re using the mobile website only, it becomes woefully inadequate with no signal. We could still find traditionals since they were loaded into the garmin, but we didn’t have the information we needed to do earth caches and multis. We also couldn’t record field notes after each find/dnf so we kept track of what we did in the garmin and plugged them into bcaching later.

What would be nice is if more mobile geocaching app developers would take advantage of the bcaching API… like geobeagle or georg for android, cachemate, etc.

Another possibility is to take advantage of html5 features that have been showing up in various mobile browsers, especially webkit. Using application caching, local storage and even local SQL databases it would be possible for a well written web app to function reasonably well without a reliable signal.

Advertisements

BCaching Field Notes API

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.

The Query API can be found here.

The Notes API is new and has had limited testing. The URL is http://(www|test).bcaching.com/…). It allows a mobile app to upload field notes (finds, dnfs, and notes). When used in combination with the BCaching Query API it can be used to prevent found caches from being re-downloaded in subsequent BCaching queries. Field notes uploaded to BCaching can also be downloaded from BCaching for use in uploading to geocaching.com.

Request format is an HTTP POST or PUT to the following URL (format is nearly identical to the query api):
http://(www|test).bcaching.com/api/notes.ashx?u=<username>&a=add&time=<current-time>&sig=<signature>
where:

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

The posted request content format is identical to the geocaching fieldnotes text file format. A utf-8 text file, with comma-separated values including waypoint, time, log-type, and text. Multiple notes can be posted when separated by newlines.

<waypoint>,<time>,<log-type>,”<text>”

where:

  • <waypoint> is the geocaching GC#
  • <time> is the complete log date and time in UTC format. For example, 2009-11-25T22:37:55Z. The time may also be expressed in local time with a time zone offset instead of the letter Z.
  • <log-type> is a valid field note log type:
    • Found it
    • Didn’t find it
    • Write note
    • Attended
    • Webcam Photo Taken
    • Private note (bcaching note only, won’t be exported)
  • <text> is the log text. Note that it is surrounded by double-quotes. It can also contain newlines inside the double-quotes and those newlines will not be treated as an end-of-record character but part of the note text.

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.