Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Why we use an API

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

40 minutes

How does a weather app know?

Your weather app shows rain for tomorrow. The weather company does not send your phone all its data.

Your phone sends one small question. The company sends back one small answer. The part that takes the question and gives the answer is an API (a door that lets one program ask another program for data).

Key words

WordWhat it meansExample
APIA door that lets one program ask another program for data.A weather app asks a weather server
DatabaseAn organised store of data in tables.A table of trips
PlatformA kind of program that uses the data: a phone app, a website, a partner company.A phone app
ServerA computer that answers requests from other computers.The weather company computer
RequestA message sent to an API to ask for something.Give me all trips
ResponseThe answer an API sends back.A list of trips
EndpointThe web address of one kind of data on an API.weather.example.com/forecast
JSONA text format for data that programs read easily.{"place":"Zoo"}
PermissionSomething a caller is allowed to do.Read only
AuthorisationDeciding what a caller may do.May this app add a trip?
Status codeA number in the response that says how the request went.200 means OK

The cells students fill in are left blank in this preview.

Quick check: what is an API?

Have a go

Quick check: what is an API?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Extra: Read an API address, part by part

PartExampleWhat it tells you
Starthttps://Talk to the server in a safe way
Serverweather.example.comWhich computer answers
Endpoint/forecastWhich kind of data you want
Filter?city=LeedsOnly the data for Leeds

The cells students fill in are left blank in this preview.

Extra: Quick check: read an address

Have a go

Extra: Quick check: read an address

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

11 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.