GeoServices

GeoServices is a REST-based application programming interface that provides developers consistent and complete access to structured data.

Using the API, developers can query data using a SQL-like where clause, geospatial and time filters, perform aggregations, sorting, text search, and spatial projection. Data are available in common [JSON](query.html) and [Image](view.html) formats.

Originally developed by Esri, in 2010 the specification was transferred to the Open Web Foundation.

To learn even more about all of the capabilities of GeoServices, read the full API documentation.

In a Nutshell

If you want to know just one thing about GeoServices - you can query for data using a location or attribute filters.

Look up which U.S. county is at a specific latitude and longitude:

http://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Places_CouSub_ConCity_SubMCD/MapServer/15/query
        ?outFields=*
        &geometryType=esriGeometryPoint
        &geometry=-77.06930,38.89733
        &inSR=4326
        &f=json

Returns JSON with an array of features. The output is truncated below:

{
  "displayFieldName": "BASENAME",
  "features": [{
    "attributes": {
      "AREALAND": 67318078,
      "AREAWATER": 244125,
      "BASENAME": "Arlington",
      "CENTLAT": "+38.8786295",
      "CENTLON": "-077.1009869",
      "COUNTY": "013",
      "COUSUB": "90072",
      "COUSUBCC": "Z7",
      "COUSUBNS": "01480097",
      "FUNCSTAT": "F",
      "GEOID": "5101390072",
      "INTPTLAT": "+38.8783374",
      "INTPTLON": "-077.1007034",
      "LSADC": "00",
      "MTFCC": "G4040",
      "NAME": "Arlington",
      "OBJECTID": 14937,
      "OID": 27653241101602,
      "STATE": "51"
    },
    "geometry": { ... }
  }],
  "fields": [ ... ],
  ...
}

Or you can search for DC Public Schools that are Elementary and have between 200 and 1000 students within a map extent:

http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Education_WebMercator/MapServer/5/query
?where=FACUSE like '%Elementary%' AND TOTAL_STUD >= 200 AND TOTAL_STUD <= 1000
&geometry={"xmin":-77.0036,"ymin":38.8879,"xmax":-76.98434,"ymax":38.90007,"spatialReference":{"wkid":4326}}
&geometryType=esriGeometryEnvelope
&inSR=4326
&outFields=*

These two examples are probably the most common use cases for using the GeoServices API. Read on for more details on advanced features.