SmartableAI / developer-program

Smartable AI Developer Program
https://developer.smartable.ai
4 stars 0 forks source link

Python requests #8

Open crieux opened 4 years ago

crieux commented 4 years ago

Hello, I think that the code to request the API using the python code provided by the "try it" example is not working. I am not familiar with requesting API using python, could you fix the python code ? Thank you

crieux commented 4 years ago

I used this code, it worked fine:

import requests
api_url = "https://api.smartable.ai/coronavirus/stats/global"
api_params = {
    "Cache-Control": "no-cache",
    "Subscription-Key": "<KEY>",
}
r = requests.get(url=api_url, params=api_params) 
data = r.json() 
SmartableAI commented 4 years ago

Thank you!! I'm working on it to fix the python code sample.

insideout commented 4 years ago

It takes more effort than I anticipated to change the sample code. We are using Microsoft Azure API Management to ship the APIs. I have submitted a support request to Azure team and ask for helps.