Skip to content

Instantly share code, notes, and snippets.

@daniellevass
Last active September 1, 2015 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniellevass/fe862d30d4591e1c14f3 to your computer and use it in GitHub Desktop.
Save daniellevass/fe862d30d4591e1c14f3 to your computer and use it in GitHub Desktop.
this equals that

#this equals that api

These are all suggestions - I'm not an API designer - I've just consumed good and bad API's in my time.

Things I consider a good API - USGS - http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson

A bad api example - flickr - they have numbers as strings and a stupid "root" object.

endpoint suggestions

/equals?param=one&param=two

e.g. /equals?type=LED&amount=100&watts=6&duration=60000

where duration is seconds (or milli seconds)

Would be ok with different endpoints for the different top level nodes e.g. LED / CFL Light Bulb / etc but one might be easier?

Results

We like JSON format :D

e.g.

{
  "coal" : 1 ,   // in m3 - could be in kgs?
  "co2" : 2,     // in m3?
  "money" : 3    // in pennies?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment