Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result data error #1

Open
shautzin opened this issue Mar 11, 2018 · 2 comments
Open

Result data error #1

shautzin opened this issue Mar 11, 2018 · 2 comments

Comments

@shautzin
Copy link

shautzin commented Mar 11, 2018

Hi, I'm using your apicn-sdk, but no matter which city I pass, it always return data of city:

"name": "Barrie, Ontario"

Something went wrong for the APIs or my code?

@miczal
Copy link
Owner

miczal commented Mar 14, 2018

Hi!

I didn't use this github account in ages 😄.

Could you provide me with your code?

I will rewrite the whole thing in the weekend - it will be typed and docstrings will be better.

@shautzin
Copy link
Author

Here's my test code:

def test():
    api = AqicnApi(secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhidden")
    result = api.get_feed("Suzhou")
    print(result)

And the result is:

{'status': 'ok', 'data': {'idx': 0, 'aqi': 34, 'time': {'v': 1521086400, 's': '2018-03-15 04:00:00', 'tz': '-05:00'}, 'city': {'name': 'Barrie, Ontario', 'url': 'http://aqicn.org/city/canada/ontario/barrie/', 'geo': ['44.382361', '-79.702306']}, 'attributions': [{'name': 'Air Quality Ontario - the Ontario Ministry of the Environment and Climate Change', 'url': 'http://www.airqualityontario.com/'}, {'name': 'World Air Quality Index Project', 'url': 'http://waqi.info/'}], 'iaqi': {'pm25': {'v': 34}, 'o3': {'v': 33}, 'no2': {'v': 5}, 't': {'v': -7}, 'p': {'v': 1003}, 'h': {'v': 92}}}}

But when I use api.get_feed() instead, it's get the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants