Overview

FuelFrog implements a REST-based API for retrieving data and manipulating related to your account for third-party developers.

Authentication

FuelFrog's API uses HTTP Basic Authentication with your FuelFrog username and password

fuels Resource

URL:

http://fuelfrog.com/api/fuels

Parameters

  • format: "json" - currently the only supported format to return the data is JSON

Format:

json

Notes:

The fuels resource will return the records representing up to 10 of the latest fillups.

Example Output

[{"id":30,"user_id":1,"created_at":"2010-06-26 22:26:59",
  "volume":"44","unit_price":"4","distance":"56","created_string":"on 2010-06-26"},
 {"id":22,"user_id":1,"created_at":"2010-05-28 23:12:49",
  "volume":"2","unit_price":"2","distance":"22","created_string":"on 2010-05-28"},
 {"id":21,"user_id":1,"created_at":"2010-05-28 23:12:35",
  "volume":"22","unit_price":"22","distance":"333","created_string":"on 2010-05-28"}]

addFuel Resource

URL:

http://fuelfrog.com/api/addFuel

Parameters

  • distance: decimal - distance travelled since previous fillup
  • unit_price: decimal - price per unit of fuel purchase
  • volume: decimal - volume of fuel purchased
  • created_at (optional): date of fillup (omit to use current timestamp) -- Dates are currently assumed to be in PST (GMT-8) and in EXIF format (e.g. 2000-01-02 23:43)

Format:

json

Example Response-Success

{"status":"success"}

Example Response-Error

{"status":"error",
    "errors":{"distance":"Please provide us with the distance you went on your last tank of gas",
              "unit_price":"Please provide us with the unit price of your last fillup",
              "volume":"Please provide us with how much gas you bought at your last fillup"}}