Geo APIs

Overview

Infochimps Geo APIs give you instant access to millions of points of geo-located data across dozens of sources. Our documentation resources below will help get you up and running in minutes. With our unique geolocators that let you search by traditional geo-methods such as quadkey, lat/lon and bounding box, as well as with a human readable street address and even an IP address, we have made it even easier to work with geo-data. Take a look at the Wikipedia Articles API call to see how effortless it is to structure a call with our Geo API.

Wikipedia Articles API Call

http://api.infochimps.com/encyclopedic/wikipedia/dbpedia/wikipedia_articles/search?g.radius=10000&g.latitude=30.3&g.longitude=-97.75&f.q=park&apikey=xxxx

This call will return a list of Geographical information that corresponds with the latitude and longitude given like, points of interest, a link to their Wikipedia page, census information about the area, and several other interesting and useful data. Refer to the documentation below to understand what features the call has that allow it to do that. (If you need a lat/long to address converter, check out stevemorse.org. )


Geolocators

There are several types of geolocators (g.query) the API supports. A g.query can be any of the following features listed below.

GeolocatorsExample
QuadkeyAlso known as the Tile ID, this is used when querying the tilestore. The Quadkey will only ever contain digits 0, 1, 2, 3.&quadkey=132221
Bounding BoxAllows you to define a rectangular area in which to examine data.&g.bbox=29,-98,31,-96
RadiusIt is the radius + latitude + longitude (r).g.radius=10000&g.latitude=30.3&g.longitude=-97.75
Zoom LevelsZoom level is measured in tile size. It is the latitude + longitude + zoomlevel.&g.latitude=37.776115&g.longitude=-122.412768&zoom_level=7
IP AddressUse an IP address as a geo location, g.ip_address.g.ip_address=67.78.118.7
GET IP AddressGET IP addresses finds the address closest to the machine you are making the call from.g.get_ip_address=tru7


More on Geolocators

Quadkeys


Quadkeys have several interesting properties. First, the length of a quadkey (the number of digits) equals the level of detail of the corresponding tile. Second, the quadkey of any tile starts with the quadkey of its parent tile (the containing tile at the previous level). The length of the quadkey depends upon the zoom level you wish to achieve. For more information on tiles and zoom, check out Tiles a la Google Maps..

Bounding Box


You may want to query about all traffic accidents that happen on I-35 in Austin, TX between Parmer Lane and Riverside, and with a bounding box you can specify such a location. The bounding box query takes a lower left / upper right set of coordinates (lat/long). See the examplefor more about the format of the query.

Radius


Radius is the maximum distance from the call's geolocated point to return results. It is measured in meters.

Zoom Levels


Zoom levels correspond to tile sizes. By tiles, we are referring to specific divisions of the Earth. For example, the whole Earth can be represented by zoom_level=0; the Earth gets split into quarters with zoom_level=1 and so on. Your specified latitude and longitude will be the center point for the tile created by your specified zoom_level. Infochimps zoom levels correspond to Google Maps zoom levels. For more information on tiles and zoom, check out this great resource, the MSDN Library. You can also read this PDF about Setting Zoom Levels.

IP Address


Use an IP address as a geolocator. IP addresses generally directly correspond to the locations of machines, which makes them very useful and interesting geolocators. The uses returns data as if the request had used a latitude and longitude.

GET IP Address


GET IP has two capabilities, the IP address submitted will determine the IP address of the machine calling our API, and use that IP address as the geolocator. This new flag makes it easy to ask questions of our API like "tell me about venues near me," without ever having to know what your longitude is or how to interpret a quadkey.



Filters

One can f. query in most API's. Fliters limit the responses returned based on criteria you define. The options for filtering vary by endpoint any 'top level' return property can be used as a filter.

f.q=“q” is a general query of all fields, and will perform an open ended search in Elastic Search for the term you provide. See the excerpt from a Wikipedia Articles Response below, where you can see an example of f.query in response: "f.query": "park". Going back to the Wikipedia Articles example call, you can see we added the filter park.

Layers

You have the ability to add different layers to your calls, because Infochimps has a variety of data available. The _type values in return objects can be used to search individual layers in our data store.

The parameter layer= has similar capabilities that the parameter l.obj_type= has, where they both utilize _type values to condense a call's responses, or return the information you most need or are interested in seeing. The _type in return objects can be used to search individual layers in our data store.

Wikipedia Articles Response

  {
  "total": 21,
  "results": [
    {
      "url": "http://en.wikipedia.org/wiki/Emma_Long_Metropolitan_Park",
      "keywords": [
        "parks",
        "austin,texas"
      ],
      "about": "Emma Long Metropolitan Park is a large park in northwest Austin, Texas.",
      "_type": "encyclopedic.wikipedia.wikipedia_article",
      "description": "Emma Long Metropolitan Park is a large park in northwest Austin, Texas.",
      "_domain_id": 26164863,
      "md5id": "38f442179ca965985950b0786350f207",
      "wikipedia_id": "Emma Long Metropolitan Park",
      "geo_geometry_type": "Point",
      "wikipedia_numeric_id": 26164863,
      "name": "Emma Long Metropolitan Park",
      "coordinates": [
        -97.83,
        30.335
      ],
      "external_links": [
        "http://rdf.freebase.com/ns/m/0b6jqj2"
      ]
    }
{
      "url": "http://en.wikipedia.org/wiki/Pease_Park",
      "contained_in": {
        "core_based_stat_areas": "12420",
        "sen_legislative_dist_uppers": "48014",
        "voting_districts": "484530266",
        "counties": "48453",
        "combined_stat_areas": "48126",
        "cities": "4805000",
        "states": "tx",
        "postal_codes": "78705",
        "census_tracts": "48453000604",
        "countries": "us"
      },
      "keywords": [
        "urban",
        "public",
        "parks",
        "austin,texas",
        "geoclass",
        "park"
      ]

Shape

If you do not specify the shape, we will return the data in its natural structure.

Currently, you can utilize geoJSON for most APIs.

Back to top.