Egypt › Secondary › Secondary Two › Programming and AI › Chapter ٥: Data Collection and Cleaning

Lesson ٣: Open Data and APIs (Item ٥-٣)

Secondary TwoProgramming and AISecond Termالدرس ٣٣٠ دقيقة

فيديو الشرح

الفيديو قيد الإنتاج، وسيظهر هنا فور اعتماده.

ماذا ستتعلم؟

اختبر استعدادك أولًا

١. In the question "What is open data?" the options are: ١) Data available for everyone to reuse, usually free and in machine-readable formats ٢) Secret data ٣) Paid-only data ٤) Images only. What is the number of the correct answer?
٢. In the question "Give an example of an open data source." the options are: ١) Your friend phone ٢) Government open data portals for statistics, weather and transport ٣) A private chat ٤) An encrypted disk. What is the number of the correct answer?
٣. In the question "What is an API?" the options are: ١) A kind of printer ٢) A full programming language ٣) An organized way for a program to request data or a service from another program ٤) A computer device. What is the number of the correct answer?

الشرح خطوة بخطوة

Level ١: We explore together

Lesson topic: Open Data and APIs (Item ٥-٣). Open data is data published for everyone to reuse and analyze, usually free of charge.

The story: Examples include government open data portals: statistics, maps and budgets in machine-readable formats. An API is a way for one program to request data from another service in an organized format. The program sends a request to the endpoint address and the service replies, usually in JSON. Some interfaces require an API key to regulate usage and prevent abuse. Using open data means respecting license terms and privacy, and never exposing personal data.

أخطاء شائعة وتصحيحها

أمثلة محلولة متدرجة

Easy · مثال ١

Define open data and give one use case.

  1. نقرأ السؤال معًا بهدوء.
  2. Available to all.
الإجابة: Public reusable data; like using open weather data in a farmers advisory app
Easy · مثال ٢

What is an API and why use it instead of copying data manually?

  1. نقرأ السؤال معًا بهدوء.
  2. Automated exchange.
الإجابة: An interface programs use to exchange data automatically and on time, instead of slow error-prone manual copying
Easy · مثال ٣

What is the most common format of API responses and its general shape?

  1. نقرأ السؤال معًا بهدوء.
  2. Structured text.
الإجابة: JSON: key-value pairs inside braces
Medium · مثال ٤

Explain why some interfaces require a key even though the data is open.

  1. نقرأ السؤال معًا بهدوء.
  2. Regulation not blocking.
الإجابة: The key counts requests, prevents consumption abuse and protects the service from attacks without blocking legitimate use
Medium · مثال ٥

Describe a full data request cycle of a weather app through an API.

  1. نقرأ السؤال معًا بهدوء.
  2. Request, reply, display.
الإجابة: The app sends a request with the city name; the server replies with JSON for temperature and wind; the app parses it and shows it to the user
Medium · مثال ٦

An app received code ٤٠١ from an API; what does it mean and how does the developer fix it?

  1. نقرأ السؤال معًا بهدوء.
  2. Authentication.
الإجابة: It means unauthorized: a missing or wrong key; the developer checks the key and its validity, then retries
Medium · مثال ٧

What is the ethical risk in merging two open datasets that together could reveal identities?

  1. نقرأ السؤال معًا بهدوء.
  2. Re-identification.
الإجابة: Merging may re-identify people even though names were removed from each set; this risk must be checked before publishing
Advanced · مثال ٨

Design an app idea that benefits your community from open data, naming the source, the API and the added value.

  1. نقرأ السؤال معًا بهدوء.
  2. A real problem.
الإجابة: Example: a congestion alert app using open transport data through its API to suggest the best bus routes right now; its value is saving commuters time
Error analysis · مثال ٩

Fix the mistake: a student republished an open dataset after adding classmates names and phone numbers to it.

  1. نقرأ السؤال معًا بهدوء.
  2. Privacy.
الإجابة: Open data does not license releasing personal data; publishing names and numbers without consent is a privacy violation and breaks usage terms

الخريطة الذهنية

Open Data and APIs (Item ٥-٣)Chapter ٥: Data Collection and Cleaning
▼
Data available for everyone to reuse, usually free and in machine-readable formatsWhat is open data?
Government open data portals for statistics, weather and transportGive an example of an open data source.
An organized way for a program to request data or a service from another programFrom the lesson questions
JSONWhat is the common format of API responses?

إنفوجرافيك: Lesson map: words of the day

Lesson map: words of the day
اضغط على أي صف لترى الفكرة.
The key ideas of the lesson in order
We review the questions after one day, then after three days

تدريبات متنوعة مع الإجابات والتفسير

اكتب الإجابة أو اختر ثم اضغط. بعد كل سؤال يظهر الحل مع التفسير.

A) I choose the answer

١. From the lesson explanation: What is an API key?
٢. From the lesson explanation: Open data is data published for everyone to reuse and analyze, usually free of charge.
٣. The answer "No difference" to the question "What is the difference between downloading an open data file and using an API?" is correct.
٤. The answer "Permission requested" to the question "What does response code ٤٠٤ mean?" is correct.
٥. Which question has the answer "The file is a fixed snapshot; the API returns updated data at each request"?
٦. The answer "MP3" to the question "What is the common format of API responses?" is correct.
٧. The answer "Paid-only data" to the question "What is open data?" is correct.

B) I practice and answer

١. From the lesson explanation: What does response code ٤٠٤ mean?
٢. The answer "A full programming language" to the question "What is an API?" is correct.
٣. The answer "The file updates faster" to the question "What is the difference between downloading an open data file and using an API?" is correct.
٤. The answer "The API is paper" to the question "What is the difference between downloading an open data file and using an API?" is correct.
٥. From the lesson explanation: Why do programs prefer JSON for data exchange?
٦. The answer "The file is a fixed snapshot; the API returns updated data at each request" to the question "What is the difference between downloading an open data file and using an API?" is correct.
٧. Which question has the answer "JSON"?
٨. From the lesson explanation: What is open data?

C) I review and play

١. The answer "It prints the screen" to the question "How does a Python program request data from an API?" is correct.
٢. From the lesson explanation: What is the common format of API responses?
٣. From the lesson explanation: Using open data means respecting license terms and privacy, and never exposing personal data.
٤. From the lesson explanation: Give an example of an open data source.
٥. From the lesson explanation: What is an API?
٦. Which question has the answer "Respecting license terms and protecting privacy"?

ملخص صوتي وقارئ الدرس

قارئ تجريبي يعمل بصوت جهازك (مجاني). ليس تسجيلًا احترافيًا، وجودة الصوت العربي تختلف من جهاز لآخر. التسجيل الصوتي الاحترافي لم يُنتج بعد.

Lesson topic: Open Data and APIs (Item ٥-٣). Open data is data published for everyone to reuse and analyze, usually free of charge.

We review the key points of the lesson: What is open data? -> Data available for everyone to reuse, usually free and in machine-readable formats; Give an example of an open data source. -> Government open data portals for statistics, weather and transport.

We apply what we learned by answering these questions: What is open data? -> Data available for everyone to reuse, usually free and in machine-readable formats; Give an example of an open data source. -> Government open data portals for statistics, weather and transport; What is an API? -> An organized way for a program to request data or a service from another program.

مسار المراجعة للامتحان

  1. Day one (١٠ minutes): We read levels ١ to ٣ together, then solve exercises (A).
  2. Day two (١٠ minutes): We play the level ٤ games and solve exercises (B).
  3. Day three (١٠ minutes): Exercises (C), then the Level One test.
  4. Before the school exam: We repeat the Level Three test and look at the common mistakes.

اختبارات بثلاثة مستويات

Level One Test: The Basics

٦ أسئلة. اجب ثم اضغط «أنهِ الاختبار» لترى درجتك.

١. Which question has the answer "A token identifying the user and regulating their usage limits of the service"?
٢. The answer "A virus type" to the question "What is an API key?" is correct.
٣. Which question has the answer "An organized way for a program to request data or a service from another program"?
٤. From the lesson explanation: Name two ethical conditions when using open data.
٥. The answer "Your friend phone" to the question "Give an example of an open data source." is correct.
٦. The answer "Respecting license terms and protecting privacy" to the question "Name two ethical conditions when using open data." is correct.

المصادر والحقوق

رمز QR هذه الصفحة. يفتح درس «Lesson ٣: Open Data and APIs (Item ٥-٣)» نفسه.