Skip to content
Pixel
العربية

Textbook answers: 5-3 Open Data and APIs

Suggested answers by the site team, the book has no answer key.

Try 1

1What is the name of the World Bank's open data portal that publishes statistics on economy, population, education, and so on for countries around the world?

Show answer

World Bank Open Data.

It publishes statistics on the economy, population, education and health for countries worldwide, useful for international comparisons when its definitions and time periods fit the question.

2What is the term for the rules for how pieces of software interact with each other, which is also widely used in web services for obtaining data?

Show answer

API (Application Programming Interface).

An API is a set of rules that lets one program request data or functions from another program or service, and it is widely used by web services to deliver data.

3What is the name of the data format widely used when data is returned from an API?

Show answer

JSON (JavaScript Object Notation).

JSON is a common text format representing structured data as objects, arrays and values; note that it is not the only format an API may use.

Note: Arabic edition: The English version asks for the format 'widely used' when an API returns data; the Arabic asks for 'a common format'. The answer is the same.

4What is the term for what should be cited when using data, both to indicate reliability and to allow verification by others?

Show answer

Citing the source (attribution / citation).

Citing the source means stating details such as the publisher, dataset name, date and link, in the way the licence or citation standard requires.

Note: Arabic edition: The English version describes the purpose as 'indicating reliability and allowing verification'; the Arabic version describes it as stating the source as the licence or citation standard requires.

Try 2

(1)From the following options (A–D), choose the one that most appropriately describes the flow of obtaining data via an API.

  • A - The client sends a request to the server, and the server returns the data in a format such as JSON.
  • B - The server one-sidedly continues to send data to the client.
  • C - Clients exchange data directly with each other.
  • D - The server only stores data; clients cannot retrieve it.
Show answer

(A) The client sends a request to the server, and the server returns data in a format such as JSON.

That is the request–response sequence. The server does not push data one-way without a request (B), clients do not exchange data directly with each other here (C), and clients can retrieve the data (D is wrong).

(2)For each of purposes (a, b), choose the most appropriate open data provider from the choices below (A–C).
a You want to compare GDP across countries.
b You want to find datasets from various fields for machine learning study.

  • A - UN Data
  • B - World Bank Open Data
  • C - Kaggle
Show answer

1 → (B) World Bank Open Data, 2 → (C) Kaggle.

GDP is an economic statistic for countries, which is World Bank Open Data's field. Varied datasets for studying machine learning are what Kaggle offers, while evaluating each dataset's source and licence.

(3)From the following options (A–D), choose the one that most appropriately describes the use of open data.

  • A - Open data can be used freely, so the terms of use do not need to be checked.
  • B - Source citation is required only for data published for a fee.
  • C - Even when using open data, it is required to cite the provider, the name of the data, the date of acquisition, the URL, and so on as the source.
  • D - For data obtained via an API, there is no need to follow the terms of use.
Show answer

(C) Even with open data, you must cite the provider, data name, date obtained, URL and so on.

Open data has terms that must be checked (A is wrong), attribution applies to all data, not only paid data (B is wrong), and API access does not cancel the terms of use (D is wrong).

Exercise 1

1Cover the Point! section with a red plastic sheet and quiz yourself in your notebook in numerical order.

Show answer

Cover the key-points section and test yourself: define open data, name the three providers and what each offers, define API, endpoint and JSON, explain the request–response steps, terms of use, and the parts of a source citation.

Draw the client–server diagram from memory and write a complete source line for a dataset you know, then compare with the lesson.

Note: Arabic edition: The English version says to cover the Point! section with a red plastic sheet.

Exercise 2

1Read the following passage and answer each question.
To use open data in analysis, it is necessary to understand where to obtain it, how to obtain it, and how to use it. Statistics on economy, population, education, and so on for countries around the world can be obtained from sources such as ( a ), operated by the World Bank. Also, in addition to downloading individually from a browser, by using ( b ), necessary data can be obtained directly in formats such as ( c ) in response to a request. When using open data, the ( d ) determined for each dataset must always be checked, and when data is used, the provider, the name of the data, the date of acquisition, the URL, and so on must be cited as the ( e ).
1. Fill in the blanks (a)–(e).

Show answer

(1) World Bank Open Data (or UN Data), (2) an API, (3) JSON, (4) the terms of use (licence), (5) attribution to the source (citation).

Blank 1 asks for 'portals such as' those publishing international indicators, so World Bank Open Data fits and so does UN Data. The other blanks follow the lesson: an API returns a response in a format like JSON, then the terms, then attribution.

This question allows more than one reading

Note: Arabic edition: In the English version blank (a) specifies a portal 'operated by the World Bank', so the answer there is specifically World Bank Open Data; the Arabic wording accepts more than one portal.

Exercise 3

(1)From the following options (A–D), choose the one that most appropriately describes Kaggle.

  • A - A portal operated by the World Bank that publishes statistics for countries around the world.
  • B - A site for international statistics operated by the United Nations.
  • C - A platform that runs data analysis competitions, on which datasets in various fields are made public.
  • D - A system that automatically records browsing histories of websites.
Show answer

(C) A platform that runs data analysis competitions, where datasets in many fields are available to the public.

A describes World Bank Open Data, B describes UN Data, and D has nothing to do with open data sources.

(2)From the following options (A–D), choose the one that is NOT an appropriate description of source citation.

  • A - Source citation is important as an indication of the reliability of the data.
  • B - Source citation is important to allow others to verify the analysis.
  • C - Sources include the data provider, the name of the data, the date of acquisition, the URL, and so on.
  • D - When using open data, it is not necessary to cite the source.
Show answer

(D) When using open data, there is no need to cite the source.

Even open data must be attributed in the required way. Statements A, B and C are appropriate: citation lets others find, evaluate and verify, and it includes the provider, name, date and link.

Note: Arabic edition: Option A in the English version says citation is 'an indication of reliability', while the Arabic says it does not prove reliability by itself; in both editions the answer is D.

(3)From the following options (A–D), choose the one that is NOT an appropriate point of caution when using an API.

  • A - Use the API in accordance with the terms of use determined by the provider.
  • B - Avoid sending excessive requests in a short time.
  • C - Confirm the scope of allowed use of the obtained data in advance.
  • D - Because of how APIs work, they may be used without checking the terms of use.
Show answer

(D) Because of how APIs work, they can be used without checking the terms of use.

API access does not cancel the licence or terms. A, B and C are correct cautions: follow the provider's terms, avoid excessive requests, and check the permitted scope of use.

Exam-style question

Explain why an analyst must check the terms of use and cite the source even when the data is free and open. [6] Refer to: your right to use the data, reliability, and letting others verify. [6]

Model answer

• Open data is available under a licence or terms; being free does not make data open and does not mean there are no rules. [1]
• Your right to use it: the terms define what access, reuse, redistribution and publishing are allowed, and they differ between datasets, so they must be read before use. [1]
• Accessing data through an API does not cancel those terms; request limits and storage and publishing policies still apply. [1]
• Reliability: evaluating the publisher, update date, collection method and definitions shows whether the data fits the question; citing the source alone does not prove reliability. [1]
• Letting others verify: citing the source (publisher, dataset name, date, link) lets a reader reach the same data, evaluate it and review the analysis. [1]
• So checking terms and citing sources makes the analysis legitimate, responsible and open to review, even with free data. [1]

Back to the lessonStart exercises