Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Using Python tool to do API

Gualigee
8 - Asteroid

I was trying to pull the climate data using API. 

I tried to use the Python tool, but it did work. 

Could somebody please help take a look? Thank you very much. 

I also attached some API Jupiter notebooks and am not sure if it helps. 

Capture.PNGCapture1.PNG

7 REPLIES 7
PhilipMannering
16 - Nebula
16 - Nebula

This pulls the climate data... Is this what you wanted?

PhilipMannering_0-1649619121871.png

 

Gualigee
8 - Asteroid

hi @PhilipMannering,

 

Thank you for your reply. 

Do i need to install something? I got an error message.

Gualigee_0-1649650623250.png

 

PhilipMannering
16 - Nebula
16 - Nebula

Hi @Gualigee

 

Ah yes. You need to install the requests package first. Information about this is here: https://help.alteryx.com/20214/designer/python-tool

You need to use the following code,

from ayx import Package
Alteryx.installPackages("requests")

To do this you'll need to right click on the Alteryx Icon > Run as Admin

 

Otherwise the attached workflow should handle this too. 

Gualigee
8 - Asteroid

Thank you, @PhilipMannering 

 

I can run your workflow now. Thank you very much. 

However, i don't know how to use the output. 

My task is to find the climate data (18 features) for each set of coordinates (please see the attached file.)

Do you know how i can achieve this?

 

PhilipMannering
16 - Nebula
16 - Nebula

Hey @Gualigee 

 

You're right. Wasn't pulling data correctly. To be honest I'm not very familiar with this API, but I did manage to pull relevant data. See if the attached workflow helps you (I used their example Jupyter Notebook on the website). This workflow does pull select data - If I try and convert everything to a dataframe then my laptop runs out of memory, presumably because its so much data. There's also a few hoops to jump through just to get the packages to import correctly (that is downloading and installing particular versions of GDAL packages). See attached. Beyond this, I don't think I'm going to be much help.

 

PhilipMannering_0-1650294863662.png

 

Gualigee
8 - Asteroid

Hi @PhilipMannering, thank you very much for your help. I will investigate more over the weekend. 

patricklshan
6 - Meteoroid

I tried using your code but get error message saying 'collection' object has no attribute 'assets'

Labels
Top Solution Authors