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

Possibly Related Threads...
Thread Author Replies Views Last Post
  why does my python request cannot work with proxy and cannot get captured by fiddler szhangpy 0 94 Jun-27-2019, 10:48 PM
Last Post: szhangpy
  Issues parsing the response from a request garnold 3 233 May-14-2019, 12:39 PM
Last Post: snippsat
  urllib request error 404 Coco 2 239 May-11-2019, 02:47 PM
Last Post: Larz60+
  Better Coding request aankrose 5 249 May-09-2019, 01:54 PM
Last Post: perfringo
  HELP! sending data to MySQL Slei 2 216 May-09-2019, 08:29 AM
Last Post: Slei
  sending html file in email santoshi 3 281 Apr-05-2019, 03:59 PM
Last Post: nilamo
  How to multiprocessing Api post request kinojom 1 201 Apr-03-2019, 01:11 AM
Last Post: Larz60+
  Error in request, cache key a21250450 2 242 Apr-02-2019, 11:20 AM
Last Post: a21250450
  sort lists of lists with multiple criteria: similar values need to be treated equal stillsen 2 206 Mar-20-2019, 08:01 PM
Last Post: stillsen
  Help Needed. Sending keystroke to video game Linkin12 1 221 Mar-03-2019, 05:54 PM
Last Post: Linkin12

Forum Jump:


Users browsing this thread: 1 Guest(s)