Skip to content

Instantly share code, notes, and snippets.

@yogi-bp
Last active April 6, 2020 13:05
Show Gist options
  • Save yogi-bp/0fd707a54ddff7c56434d920d4c79546 to your computer and use it in GitHub Desktop.
Save yogi-bp/0fd707a54ddff7c56434d920d4c79546 to your computer and use it in GitHub Desktop.
Get All Prices

PRICES API

Get product prices

Prices API Endpoints

Prices

Get prices

Request

GET /prices/get/?date=2020-04-01&page=191 HTTP/1.1
Host: 127.0.0.1:5000
X-api-key: byprice_generated_api_key
X-user-session-token: x_user_session_token
Content-Type: application/json

Get prices from specified client and dates

Method: GET

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

Query Params:

Param Description Condition
date Desired Prices of Date (YYY-MM-DD) optional, default today
date_start Starting Date of prices (YYY-MM-DD) optional
date_end Ending Date of prices (YYY-MM-DD) optional
page Number of page optional, default=1

Response

Status : 201

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