Skip to content
Advertisement

Tag: api

Python: when trying to extract certain keys, how can I avoid a KeyError when in some dict elements, the key value is missing from APi json?

I can successfully extract every column using Python, except the one I need most (order_id) from an API generated json that lists field reps interactions with clients. Not all interactions result in orders; there are multiple types of interactions. I know I will need to add the flag to show ‘None’ and then in my for loop and an if-statement

Python websocket closes after few seconds

I am try subscribe API http://developers.xstore.pro/documentation/ Process how I am doing it. Login (Ok) Subscribe some command (Ok) The data starts coming in (Ok) After few second (cca 20s) (Fail) on: Python or API closes connection :( inicialize socket: Every 5s I am sending following ping There is a way to open new connection but this approach it’s not optimal.

IBKR TWS API reqIds does not send back any messages to nextValidId

Shouldn’t the following code at least print “hi”, as I connect to the API and then reqIds is supposed to shoot a message back to nextValidId? Instead, when I run this, nothing happens at all. Answer delete these lines You don’t need to request ids on startup, the next one comes automatically. Don’t disconnect before you get a response. If

Conversion app to display the date and result

I have created a currency conversion app as users need to input the currency from, to and the amount required. I have successfully retrieved the data from the API, when I click the button the result label was shown all the data below rather than the date and result of the currency’s conversion. How could I display the date and

Efficiently using the OpenElevation API using Python

I have a large set of latitude/longitude coordinates and would like to get the elevation for each. I want to use the OpenElevation API. According to their API Docs, I can get elevation data through the URL: https://api.open-elevation.com/api/v1/lookup?locations=10,10|20,20|41.161758,-8.583933. As you can see from the example URL, it is possible to get many elevations in a single request (provided you are

Advertisement