Creating a Api links by url & list from a saved df

KayCon86
New Contributor

I have 106,000 + api's I need to call, so instead of calling them one by one I would like to create a loop as I have the list of location Id's which I've called from there api locations list and these will sit at the end of the url to get more info on each location as the location list is limited.

 

e.g I want it to bring back all 106,000 api links from the 'IdColumn' from my loaded list

www.apilink/24582

www.apilink/24563 ....

 

Please see code below if anyone could help it would be so helpful.

 

from pyspark.sql.types import StructField, StructType, StringType, DataType, Row

 

Idlist = spark.read.load("loadedfile.paquet")

locid = Idlist.select('IdColumn')

 

LookUppy = str('https://apilink/locations/') + str(Idlist['IdColumn'])

print(LookUppy)

 

I get this as the output =

https://apilink/locations/<'ldColumn'>;