OCLC Developer Network

Find a Library Near Me

This request type can be used to find libraries near a given location in two ways: geolocation with radius or by country/state.

Geolocation request with radius:

  • Exactly one of the following parameters is specified: long + lat, postalCode, ip
  • Radius and units both apply (defaults are used if omitted from the request)
  • A countryCode OR stateCode may be supplied. If so, the results are filtered to include entries only in those locations regardless of radius.

Country or state only request:

  • Only a countryCode or stateCode are supplied. If both are supplied, the countryCode should match the state code or else zero results are likely.
  • Radius and units do not apply.
  • The search results will return libraries in the state/country in alphabetical order by name. The response will not contain a distance value.

Available Parameters:

NameDescriptionREquired ?
longlongitude (-180 thru 180) 
latlatitude (-90 thru 90) 
postalCodeThe postal code/zip 
ipAn IP address to use to determine geolocation 
countryCodeThe ISO-3166 A2 country code (e.g. US) 
stateCodeThe ISO-3166-2 state/province code (e.g. US-OH) 
radiusThe radius in miles/kilos etc, valid values: 1-100, default=20 
unitsThe units for the radius ("miles", "kilos", "nauticalmiles"), default=miles 
instTypesComma separated list of institution type integers to include (e.g. 1,10,18) 
omitInstTypesComma separated list of institution type integers to omit (e.g. 2,12) 
wskeyAn OCLC web service keyRequired
maximumRecordsInteger - Maximum record to retrieve, valid values: 1-100, default=20 
startRecordInteger - The starting record number to retrieve, default=1 

Output Formats

The service is capable of outputing data in both XML and JSON formats. This is done by changing the extension on the end of the url

XML 

http://www.worldcat.org/libraries/geosearch.xml?

JSON

http://www.worldcat.org/libraries/geosearch.json?


Examples

Find all the libraries within a 30 mile radius of Madison, WI (43.073465,-89.40112)

http://www.worldcat.org/libraries/geosearch.xml?lat=43.073465&long=-89.40112&radius=30&units=miles&wskey=[yourkey]

http://www.worldcat.org/libraries/geosearch.json?lat=43.073465&long=-89.40112&radius=30&units=miles&wskey=[yourkey]

Find all the public libraries within the state of Rhode Island

http://www.worldcat.org/libraries/geosearch.xml?countryCode=US&stateCode=US-RI&instTypes=3&wskey=[yourkey]

http://www.worldcat.org/libraries/geosearch.json?countryCode=US&stateCode=US-RI&instTypes=3&wskey=[yourkey]

Follow the OCLC Developer Network:

The OCLC Developer Network supports the use of OCLC Web Services—a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. learn more »

© 2010 OCLC Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates


Powered by Drupal, an open source content management system