Mobile App Available!!!

iPhone, Android, Windows Phone : m.mygasfeed.com

API Requests

There are two domain urls you have to keep in mind. One domain is for development for testing. All developers will use this API Key: rfej9napna. Once your app is done you should use the production URL and your registered API key.

Development url : http://devapi.mygasfeed.com/
Development API Key : rfej9napna
Production url : http://api.mygasfeed.com/

Note: Using the development url might not contain any data since it's a development database.

Geo Location Nearby Gas Stations (UPDATED!!!)

Retrieves distance in miles radius of near by gas stations according to a user's geo location. You will need to provide the latitude and longitude from the mobile device or browser. You can plot these stations on a map or a list.

Request Url example: /stations/radius/(Latitude)/(Longitude)/(distance)/(fuel type)/(sort by)/apikey.json?callback=?

Method: GET

Arguments:
Latitude
Longitude
Distance - A number (miles) of the radius distance of stations according to the user's geo location
Fuel Type - Argument types: reg,mid,pre or diesel. Which type of gas prices that will be returned.
Sort By (Distance or Price) - Type arguments: price or distance. Gas stations will be sorted according to the argument.
apikey - An Api key
Callback - Only needed for JSONP requests

Example of JSON Response:
 {
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "geoLocation": {
        "city_id": "147",
        "city_long": "Saint-Laurent",
        "region_short": "QC",
        "region_long": "Quebec",
        "country_long": "Canada",
        "country_id": "43",
        "region_id": "35"
    },
    "stations": [
        {
            "country": "Canada",
            "reg_price": "3.65",
            "mid_price": "3.65",
            "pre_price": "3.65",
            "diesel_price": "3.65",
            "address": "3885, Boulevard Saint-Rose",
            "diesel": "0",
            "id": "33862",
            "lat": "45.492367",
            "lng": "-73.710915",
            "station": "Shell",
            "region": "Quebec",
            "city": "Saint-Laurent",
            "reg_date": "3 hours agp",
            "mid_date": "3 hours agp",
            "pre_date": "3 hours agp",
            "diesel_date": "3 hours agp",
            "distance": "1.9km"
        }
    ]
}
    

Gas Prices History (NEW!!!)

Retrieves a list of gas price histroy for a particular gas station.

Request Url example: /locations/pricehistory/(station id)/apikey.json?callback=?

Method: GET

Arguments:
station id - The id of the gas station.
Api Key
Callback - Only needed for JSONP requests

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "histroy": [
        {
            "type": "Pre",
            "price": "3.33",
            "date": "1 day ago",
            "via": "myGasFeed Dev"
        },
        {
            "type": "Regular",
            "price": "6.66",
            "date": "1 day ago",
            "via": "myGasFeed Dev"
        },
        {
            "type": "Regular",
            "price": "3.33",
            "date": "1 day ago",
            "via": "myGasFeed Dev"
        },...
    ]
}
    

Gas Station Details

Retrieves gas station details by providing the station id. The station id can be retrieved when making a request for a list of stations.

Request Url example: /stations/details/(Stattion Id)/apikey.json?callback=?

Method: GET

Arguments:
Station id - The number id of station
Api Key
Callback - Only needed for JSONP requests

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "details": {
        "address": "3885, Boulevard de la Cavendish",
        "id": "33862",
        "city": "Saint-Laurent",
        "region": "Quebec",
        "country": "Canada",
        "lat": "45.492367",
        "lng": "-73.710915",
        "station_name": "Shell",
        "reg_price": "3.45",
        "reg_date": "6 min ago",
        "mid_price": "3.69",
        "mid_date": "4 hours ago",
        "pre_price": "3.89",
        "pre_date": "5 mins ago",
        "diesel_date": "4.09",
        "diesel": "0" //0 contains no diesel pump, 1 contains a diesel pump
    },
    "previousPrices": [
        {
            "type": "Pre",
            "price": "3.74",
            "date": "11 hours ago",
            "via": "myGasFeed"
        },
        {
            "type": "Regular",
            "price": "3.67",
            "date": "11 hours ago",
            "via": "myGasFeed"
        }
    ]
}
        

Gas Station Brands

Retrieves a list of all gas station brands.

Request Url example: /stations/brands/apikey.json?callback=?

Method: GET

Arguments:
Api key
Callback - Only needed for JSONP requests

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "stations": [
        {
            "name": "7-Eleven",
            "id": "42"
        }...(more)
    ]
}
        

Updating Gas Prices

Updating gas prices for a particular gas station. All fields must be supplied with the exact name as described below. You will not be able to use JSONP or a straight POST from javascript ajax. Must be done all on the server side using cURL for PHP developers.

Request Url example: /locations/price/apikey.json

Method: POST

Note: Once price is updated successfully you will receive json data response with the station details.

Form Field Names:
price - Actual gas price. Format (3.64)
fueltype - Type of fuel. Arguments to be passed: reg,mid,pre,diesel
stationid - The current location id of the station that will be updated. Add the integer to a hidden field.

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "details": {
        "country": "Canada",
        "city": "Saint-Laurent",
        "region": "Quebec",
        "reg_price": "1.18 \u00a2\/Litre",
        "mid_price": "N\/A",
        "pre_price": "1.26 \u00a2\/Litre",
        "diesel_price": "N\/A",
        "address": "8300-8500, Rte Transcanadienne",
        "diesel": "0",
        "id": "33863",
        "lat": "45.488991",
        "lng": "-73.725204",
        "station": "Ultramar",
        "reg_date": "0 seconds ago",
        "mid_date": "N\/A",
        "pre_date": "23 hours ago",
        "diesel_date": "N\/A"
    },
    "previousPrices": [
        {
            "type": "Regular",
            "price": "1.18 \u00a2\/Litre",
            "date": "0 seconds ago",
            "via": "myGasFeed"
        },...

    ]
}
        

Address Location By Lat & Lng

Providing the latitude & longitude of the current location, you will retrieve the full address. An example how to use this request when adding a gas station by picking up the address information at a specific gas station without having the user to enter the info.

Request Url example: /locations/geoaddress/(Latitude)/(Longitude)/apikey.json

Method: GET

Arguments:
Latitude
Longitude
API Key.

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "location": {
        "country_short": "CA",
        "lat": "45.5092499",
        "lng": "-73.7167247",
        "country_long": "Canada",
        "region_short": "QC",
        "region_long": "Quebec",
        "city_long": "Saint-Laurent",
        "city_short": "Saint-Laurent",
        "address": "14073, Boulevard Cavendish",
        "result": "OK"
    }
}
        

Close By Gas Stations (New!!!)

Retrieve a list of other gas stations that are close by to a particular station by just suppling the station id.

Request Url example: /locations/otherclosebystations/(Station Id)/(Limit)/apikey.json

Method: GET

Station Id - The id of the gas station.
Limit - Number of gas stations needed to be returned.
Api Key
Callback - Only needed for JSONP requests

Example of JSON Response:
{
    "status": {
        "error": "NO",
        "code": 200,
        "description": "none",
        "message": "Request ok"
    },
    "stations": [
        {
            "country": "United States",
            "reg_price": "3.49",
            "address": "330 N Federal Hwy",
            "id": "36076",
            "station": "Mobil",
            "region": "Florida",
            "city": "fort lauderdale",
            "reg_date": "2 weeks ago",
            "distance": "0.3 miles"
        },
        {
            "country": "United States",
            "reg_price": "3.57",
            "address": "1420 E Sunrise Blvd",
            "id": "36080",
            "station": "Sunoco",
            "region": "Florida",
            "city": "fort lauderdale",
            "reg_date": "2 weeks ago",
            "distance": "0.7 miles"
        },
        {
            "country": "United States",
            "reg_price": "3.45",
            "address": "460 W Broward Blvd",
            "id": "36111",
            "station": "Shell",
            "region": "Florida",
            "city": "fort lauderdale",
            "reg_date": "2 weeks ago",
            "distance": "0.9 miles"
        }
    ]
}