Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Sending API request with two criteria
#1
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()])
Quote

Top Page

Messages In This Thread
Sending API request with two criteria - by hey_arnold - Feb-07-2019, 09:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)