Philly Hoods

Fork me on GitHub

a neighborhoods API for Philadelphia

Use this simple API to get data about neighborhoods in Philadelphia.

Give it a neighborhood name and it'll try to give you the GeoJSON of it:

GET http://api.phillyhoods.net/v1/neighborhoods/bella vista
{
    "request":{
        "neighborhood":"bella vista"
    },
    "results":{
        "type":"FeatureCollection",
        "features":[
            {
                "type":"Feature",
                "geometry":{
                    "type":"Polygon",
                    "coordinates":[
                        [[-75.155496,39.942376],[-75.155452,39.94237],
                        ...
                        ]]
                    ]
                },
                "properties":{
                    "name":"Bella Vista",
                    "alias":"BELLA_VISTA",
                    "dataset":"azavea"
                }
            }
        ]
    }
}

Perhaps more importantly, you can also pass lat,long coordinate pairs:

GET http://api.phillyhoods.net/v1/locations/39.952335,-75.163789
{
    "request":{
        "x":"-75.163789",
        "y":"39.952335"
    },
    "results":{
        "type":"FeatureCollection",
        "features":[
            {
                "type":"Feature",
                "geometry":{
                    "type":"Polygon",
                    "coordinates":[
                        [[-75.154716,39.95335],[-75.155158,39.951326],
                        ...
                        ]]
                    ]
                },
                "properties":{
                    "name":"Center City East",
                    "alias":"CENTER_CITY",
                    "dataset":"azavea"
                }
            }
        ]
    }
}

CORS is enabled, however you can pass a param of ?jsonp= or ?callback= if you require JSONP.

I'm currently hosting this on the free tier of OpenShift so I'm throttling by IP to three requests/sec. If you go over that you'll start getting 429 Too Many Requests responses. If you think you'll need more than this get at me: @ddw17.

Try It Out!

Go!

NOTE: Coordinates are approximate

Wrappers

NodeJS wrapper on NPM

More coming soon!

About the Data

The neighborhood boundaries dataset used in this API is graciously provided by Azavea under the Creative Commons Attribution 3.0 license meaning it can be freely used and shared. Azavea is not involved in any way with this project.

Please also keep in mind that there is no official neighborhood boundary dataset. There are many different versions for Philadelphia. In the future I'd like to include others (see below) to give the user more options.

Future

In the future this API may be able to:

  • Take an address and tell you the neighborhood
  • Take coordinates pairs for coordinates systems besides Web Mercator
  • Include other neighborhood boundaries besides Azavea's
  • Take a GeoJSON line or polygon geometry and tell you which neighborhood(s) it's in
  • Other data formats besides GeoJSON (KML?)
  • Include additional data by neighborhood (Census?)

This API was created by Dave Walk. Read a blog post about the technologies behind it. Have a question, feature request or want to help? Open an issue on GitHub or contact me @ddw17.