Skip to content

Instantly share code, notes, and snippets.

@yogi-bp
Last active April 17, 2020 15:06
Show Gist options
  • Save yogi-bp/8a842ae61390ca5929ffaf500dd58a4d to your computer and use it in GitHub Desktop.
Save yogi-bp/8a842ae61390ca5929ffaf500dd58a4d to your computer and use it in GitHub Desktop.

Justo APIs

Get retailer prices

Request

GET /prices/get/?client_codes=6987840,5783801&retailers=superama,city_market&date=2020-04-01&page=12 HTTP/1.1
Host: prices-api.byprice.com
X-api-key: Client_read_key
Content-Type: application/json

Get prices from specified products and dates. If date_start and date_end are not provided it will return prices for today. If only date_start is provided it will return prices only for that specific date. If client_codes is not in the params, it will return all the products paginated.

Method: GET

Endpoint: /prices/get/?client_codes=<csv string | optional> &retailers=<csv string | optional> &date=<date | optional>&date_start=<date_start | optional>&date_end=<date_end | optional>&page=<page | optional>

Query Params:

Param Description Condition
client_codes client_codes list separated by comma to get only those products optional
retailers retailers list separated by comma to get only those retailers optional, possible values: "walmart", "superama", "city_market", "fresko", "la_comer", "chedraui", "heb", "soriana"
date_start Starting Date of prices, (YYYY-MM-DD) optional, default today
date_end Ending Date of prices, (YYYY-MM-DD) optional, default today
page Number of page, (int) optional, default=1

Response

Status : 201

{
    20200401: [
        {
            client_code: "6987840",
            client_price: "80",
            gtin: "07502226293752",
            name: "PHARMAFET TABL 850MG x 30",
            prices: [
                {
                    avg_price: "93.0",
                    max_price: "93.0",
                    min_price: "93.0",
                    retailer: "superama"
                },
                {
                    avg_price: "65.5",
                    max_price: "65.5",
                    min_price: "65.5",
                    retailer: "city_market"
                }
            ]
        },
        {
            client_code: "5783801",
            client_price: "",
            gtin: "07501277088935",
            name: "METFORMINA GI PROT TABL 850MG x 30",
            prices: [
                {
                    avg_price: "43.189998626708984",
                    max_price: "43.189998626708984",
                    min_price: "43.189998626708984",
                    retailer: "superama"
                }
            ]
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment