Getting email from a third party tool using api

Hi,
I have a database with the prospects name, domain and other info such as emails. I have to manually find email for some of them in some particular cases. SO I want to connect my email finder tool with the api, but not for all the rows. I think I will connect the formula with a button so that it only works when I press the button.
My main problem is connecting the tool with api. With the ai assistant and email finder tool documentation i come up with the following formula;

email_finder_api_key = 'api key'



api_url = f'https://app.findymail.com/api/search/name={$name}&company={$domain}&api_key={email_finder_api_key}'





response = requests.get(api_url)


data = response.json()





if 'email' in data:


   return data['email']


else:


   return None

it says name error, requests not defined. then i thought maybe i need to import request. so I added

import request

at the first line. but then it says module not found. maybe you need to install it. Any idea how can I get this done?
Thanks in Advance!

Grist formulas run in a secure sandbox without access to the network. Here is an answer to a similar question:

If running a self-managed server, there is an experimental REQUEST function you can enable while running code in a sandbox. See this thread: Python requests package.

In normal hosted Grist (on getgrist.com), there is no way for formulas to talk to the outside world. The other options are the REST API (where you are responsible to running your script), integrator services, and Custom Widgets.