0

I'm trying to use this curl request:

curl 'https://cloud.estimote.com/v2/analytics/visits?from=1448928000&to=1451606399&granularity=daily' -X GET -u YOUR_SDK_APP_ID:YOUR_SDK_APP_TOKEN

which outputs data in this form

{
"data": [{
"date": "2016-02-22",
"count": 183
}, {
"date": "2016-02-23",
"count": 162
}]
}

I want to use python to call the curl request. How do I do this?

Here's some documentation info: Documentation

1 Answer 1

1
import requests

response = requests.get('https://cloud.estimote.com/v2/analytics/visits?from=1448928000&to=1451606399&granularity=daily', headers={'Authorization': 'access_token myToken'})

You can then look at the response information, such as response.content, response.text, etc...

Something like this, depending on the api/token http://docs.python-requests.org/en/master/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.