wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FinTech 05-2 APIs

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What were the objectives of Day 2 of APIs?

a)

Set authentication for the Alpaca SDK

b)

Use SDKs to analyze financial data

c)

Create a real-time portfolio tracker

d)

Register for an API key and use the requests library for authenticated requests

2.

How should you hide your API keys?

a)

Hardcode and then delete them before submitting any work

b)

Store them in environmental variables

c)

Blur out the keys

d)

Use a dummy key

3.

Which APIs did we discuss during that class?

a)

Alpaca

b)

Plaid

c)

Yahoo Finance

d)

Quandl

4.

Which is the typical syntax used to pass an API key through a url?

a)

?api_key=____

b)

#api_key=____

c)

{api_key = ____ }

d)

It's not safe to pass your API key through a url.

5.

Which package do we use to set environmental variables?

a)

requests

b)

os

c)

dotenv

d)

pathlib

6.

What function do we use to call an environmental variable?

a)

response.get()

b)

read_key()

c)

load_dotenv()

d)

os.getenv()

7.

What is the recommended way to check that your api key loaded correctly?

a)

Print it

b)

Save it to a variable

c)

Check the type or length

d)

Make an API call

8.

Which is the correct sequence of steps to make a call to the Alpaca API?

Call SDK functions to get data (like get_barsets)

Create an Alpaca object (using REST)

Load environmental variables

a)

Call, create, load

b)

Load, create, call

c)

Create, call, load

d)

Load, call, create

9.

How was unit 5-2 for you?

4 lines
10.

Any suggestions for improvement?

4 lines