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
| Word | What it means | Example |
|---|---|---|
| API | A door that lets one program ask another program for data. | A weather app asks a weather server |
| Database | An organised store of data in tables. | A table of trips |
| Platform | A kind of program that uses the data: a phone app, a website, a partner company. | A phone app |
| Server | A computer that answers requests from other computers. | The weather company computer |
| Request | A message sent to an API to ask for something. | Give me all trips |
| Response | The answer an API sends back. | A list of trips |
| Endpoint | The web address of one kind of data on an API. | weather.example.com/forecast |
| JSON | A text format for data that programs read easily. | {"place":"Zoo"} |
| Permission | Something a caller is allowed to do. | Read only |
| Authorisation | Deciding what a caller may do. | May this app add a trip? |
| Status code | A 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 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Extra: Read an API address, part by part
| Part | Example | What it tells you |
|---|---|---|
| Start | https:// | Talk to the server in a safe way |
| Server | weather.example.com | Which computer answers |
| Endpoint | /forecast | Which kind of data you want |
| Filter | ?city=Leeds | Only 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 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.