Skip to content

3 min read

What Is an API?

An API is a set of rules that lets one program ask another program for data or an action, using a predictable request and response format.

Create an account to save your progressNo installation

At a glance

What it is

API stands for Application Programming Interface. It defines the requests a program may send to another program, the information each request must include, and the form of the answer it will receive. An API lets software parts work together without needing to see each other's internal code.

A request usually names an endpoint, which is a web address for one resource, and a method that says what to do. Common methods are GET to read data, POST to create data, PUT or PATCH to change data, and DELETE to remove data.

The response includes a status code and often a body with data. A status code 200 means success, 404 means the requested resource was not found, and 500 means the server had an internal error. Many APIs send the body in JSON, a plain text format that stores named fields.

Inside your account

What an account adds to the pages you are reading.

Practice questions

Multiple-choice questions with answers you can check.

Games

4 short practice games in maths and science.

Glossary and simulators

424 glossary terms in plain English, and browser simulators.

Key ideas

Example

A weather app wants the temperature for one city. It sends a GET request to the weather service's endpoint for that city. If the city exists, the service returns status 200 and a JSON body with a field such as 'temperature': 21. If the city name is wrong, the service returns 404.

Question: a service allows 100 requests per minute, and an app has already made 60 in the current minute. How many more requests can it make? 100 minus 60 leaves 40 more requests.

Common mistakes

Summary

An API defines how one program requests data or actions from another. Requests use endpoints and methods, responses carry status codes and data, and secret keys must stay private. Knowing these parts makes it easier to read and debug any API.

Frequently asked questions

Is an API the same as a library?

Not exactly. A library is code that runs inside your program. An API is a set of rules for asking another program for something, often over a network.

What is JSON?

JSON is a plain text format that stores data as pairs of names and values, such as 'temperature' and 21. Many APIs use it for responses because both people and programs can read it.

Why must an API key stay secret?

A key identifies who is making requests, and a service may limit or charge usage based on it. If someone else gets the key, they can use the account's permissions and quota.

Related pages

DersTeders AI

A study companion beside your lesson

Ask about the part you are stuck on, follow a solution step by step, and revisit the same topic with fresh examples.

Available from your panel. Sign in to open the AI section there.

The library behind these pages holds 5,082 topics and 201,970 practice questions.

Create your account

Keep your progress in one place

  • Pick up every lesson where you stopped
  • Answer practice questions and see your results
  • Use the simulators and games with one account

Test yourself

5 questions · answers appear as you go

0 / 5
According to the third paragraph, deep earthquakes are useful to geologists mainly because they ______.

Answer: trace the paths of slabs that have entered the mantle. The passage states that the deepest earthquakes cluster along thin, sheet-like structures that read as ancient ocean crust, so the correct completion is that they trace slab paths. The other options fail because the text says nothing about predicting earthquakes or measuring the core.

According to the fourth paragraph, a cold slab should ______ because it is chemically different from the hot mantle around it.

Answer: give up its distinct composition slowly as it sinks. The blank stands where the passage explains what follows from a chemical difference, and the sentence after it says that chemical signals reveal how far a slab travels. Therefore the correct completion is that it gives up its composition slowly, since the passage insists the change is gradual rather than sudden.

Which of the following best expresses the essential information in the passage?

Answer: Deep earthquakes map the paths of cold slabs, which changed how geologists read the mantle.. The passage moves from subduction, to the old disagreement, to seismic evidence, and finally to the use of deep quakes as a record of swallowed slabs. Because the last paragraph draws a practical conclusion from that evidence, the essential information is that deep earthquakes map the paths of slabs.

What did researchers report in the early 1990s that helped settle the argument about slabs?

Answer: That strong, continuous layers existed deep inside the mantle.. Paragraph three says that in the early 1990s researchers reported strong, continuous layers deep inside the mantle and read them as ancient ocean crust. Because those layers were taken as subducted material, they settled the dispute between the fragmentation model and the intact-slab model.

The word swallowed in the fourth paragraph is closest in meaning to ______.

Answer: taken in. In that phrase a cluster of deep quakes may mark material swallowed long ago, which means rock carried down and taken in by the mantle. Because the passage uses the word for rock drawn beneath the surface, taken in is correct, and not set free or spat out.

Türkçe kaynak: API ile Veri Alışverişi