Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting an API Key in google colab

I have been working in Python for a short time and know I am trying to use and API that needs a key. I have been given a key consisting in a bunch of numbers and letters. When I search through the internet in order to learn how to "implement" the key I just get opinion and tips but no one talks about how to do it itself. I am using Google Colab.

Could you help me or direct me to some place where it is explained, please?

like image 751
Videgain Avatar asked Sep 19 '25 08:09

Videgain


1 Answers

Here you have the code that you can use directly in Colab:

!pip install eiapy
import os
os.environ['EIA_KEY'] = you_API

from eiapy import Series
cal_to_mex = Series('EBA.CISO-CFE.ID.H')
cal_to_mex.last(5)

The last 3 lines are taken from the example at this link. I tried it now and it works for me!

like image 80
SilentCloud Avatar answered Sep 21 '25 22:09

SilentCloud