Skip to content
Advertisement

how pass variables in api calll python?

i have a simple api call that should return me the news based on stock tickers i pass in the get request. But I would like to pass the data array to the API call. How do I pass all the values in the data list to the API call request?

JavaScript

Advertisement

Answer

You can use params in requests to use arguments in url

JavaScript

Eventually you can use string formatting with {} and .format(data_str)

JavaScript

or f-string with {data_str}

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement