safe2pee api (JSON output) v1.1 updated 10/05/10. All queries to retreive data do not require an api key, if you want to add listings you can email us for one and use it in your apps! info at safe2pee dot org USAGE TERMS: Not for profit, please credit safe2pee. If you will be querying at a super high volume let us know so we can figure something out! All data has been supplied by users, we cannot confirm the validity of supplied information.
see sample code with google maps integration: sample code
citylist.php (e.g. city=lansing&state=mi)
returns listing of bathrooms by city/state, province
all possible city/state values here
sample output
{
"status":"success",
"city":"kansas city",
"state":"mo",
"tally":"2",
"bathrooms": [
{
"bid":"MTQ4MyBTMlA=",
"name": "Hall\'s",
"lat":"39.041428",
"long":"-94.589769",
"street":"211 Nichols Rd.",
"city":"Kansas City",
"state":"MO",
"postal":"64112-1524",
"gendered":"1",
"accessible":"0",
"availability":"1",
"directions":"Basement level.",
"comment":"The most finely appointed department store toilets I have ever seen."
},
{
"bid":"MTQ2OCBTMlA=",
"name": "Commerce Arcade",
"lat":"39.102183",
"long":"-94.582075",
"street":"1000 Walnut",
"city":"Kansas City",
"state":"MO",
"postal":"64106-2107",
"gendered":"0",
"accessible":"0",
"availability":"1",
"directions":"2nd floor to the left of the escalator.",
"comment":"Open business hours."
} ]
}
proxlist.php (location=castro+at+market+san+francisco%2Cca&distance=2&access=1)
find bathrooms nearby
sample output
{
"status":"success",
"location":"37.762640,-122.435159",
"radius":"1",
"tally":"45",
"bathrooms": [
{
"bid":"MTIgUzJQ",
"name": "Mission Creek Cafe",
"lat":"37.757358",
"long":"-122.421330",
"dist":"0.839",
"street":"968 Valencia Street",
"city":"San Francisco",
"state":"CA",
"postal":"94110-2322",
"gendered":"0",
"accessible":"0",
"availability":"0",
"directions":"Head straight back. behind a divider.",
"comment":"no key"
},
{
"bid":"MTYgUzJQ",
"name": "Coffee To The People",
"lat":"37.770064",
"long":"-122.445174",
"dist":"0.75",
"street":"1206 Masonic St",
"city":"San Francisco",
"state":"CA",
"postal":"94117-2917",
"gendered":"0",
"accessible":"1",
"availability":"0",
"directions":"towards the rear of the coffee shop.",
"comment":"usually clean"
} ] }
commentlist.php (bid=ODI3IFMyUA==)
display comments of a particular listing
sample output
{
"status":"success",
"bid":"ODI3IFMyUA==",
"tally":"10",
"comments":[
{
"name": "JIFFI STOP",
"date":"2007-04-23 00:00:00",
"comment":"Michigan Dept of Transanitation JIFFI website: http://www.xanga.com/JIFFI_STOP"
}
,
{
"name": "anon",
"date":"2007-04-27 00:00:00",
"comment":"I don't buy it. I think this is a joke."
} ] }
queries that require a key
addlisting.php (key=SAMPLE&name=YourPlace&street=24th+and+Valencia&city=San+Francisco&state=CA&lat=37.7521&long=-122.4208&access=1&type=0&avail=3&comment=good food&directions=in back )
add a listing (api key required). at the moment all values must be derived from the client app. in the future this function will be able to reverse geocode automatically.
Sample output
{ "status":"success","message":"added!" }
{
"status":"failed",
"message":"invalid key"
}
addcomment.php (key=SAMPLE&bid=ODI3IFMyUA==&comment=hi there&name=me)
{ "status":"success","message":"added!" }
{
"status":"failed",
"message":"invalid key"
} {
"status":"failed",
"message":"database issue"
}
--------
state/province code array