ver. 1926 (dbed1d0)
services/apiref
services/apisrv
services/attrs
services/caches
services/caches/formatters
services/caches/map
services/caches/search
services/caches/shortcuts
services/logs
services/logs/images
services/oauth
services/replicate
services/users

Resolve cache references from given URLs
:: services/caches/search/by_urls method

Minimum Authentication: Level 1 (see Authentication Levels)
https://www.opencaching.de/okapi/services/caches/search/by_urls

Given a set of URLs, determine codes of geocaches referenced within them.

This might be useful if you have a link to an Opencaching geocache page, but you're not able to extract cache code from such link (and you need the cache code to operate on a cache using OKAPI). Geocache pages may be referenced using various types of URLs, only some of them contain the cache code.

urls required

Pipe-separated list of URLs. No more than 500.

as_dict optional

Default value: false

If false, then the result of this method will be compatible with search/all method (and therefore can be used with search_and_retrieve).

If true, then the result will be a dictionary. Your URLs will be mapped to the keys of this dictionary. Each value will be either a string (cache code) or null (if no cache code was found for the given URL).

format optional Standard common formatting argument.
callback optional Standard common formatting argument.
Plus required consumer_key argument, assigned for your application.

Returned value:

As described in the as_dict parameter.

Examples:

For by_urls?urls=url1|url2|url3 query, the result might look something link this:

{"results": ["OP28F9"]}

For by_urls?urls=url1|url2|url3&as_dict=true query, the result might look something link this:

{"url1": "OP28F9", "url2": null, "url3": "OP28F9"}