Python Forum

Full Version: Sending API request with two criteria
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

If I run the below it won't work, however if I remove one key & value from payload it returns and answer.

How do I give payload two keys and values and get a result? Is it something to do with they json keys? I noticed that I can replace operationaldatas with meta or operationaldata, do I need to use one of these to search for the other key:values?


import requests
import pandas as pd
payload = {'pointLabel':'Isle of Grain','periodFrom':'2019-02-07T06:00:00+01:00'}
r =  requests.get('https://transparency.entsog.eu/api/v1/operationaldatas', params = payload)
website_data = r.json()['operationaldatas']
df_entsog=pd.DataFrame([[k for k in i.values()] for i in website_data],
                          columns=[i for i in website_data[0].keys()])