{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ch13-title",
   "metadata": {},
   "source": [
    "# APIs"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch13-overview",
   "metadata": {},
   "source": [
    "APIs let your code communicate with web services, data sources, and cloud tools.\n",
    "\n",
    "- REST APIs and HTTP methods\n",
    "- `requests.get()` and response objects\n",
    "- JSON data as Python dictionaries and lists\n",
    "- Query parameters and headers\n",
    "- Reliability patterns for errors, timeouts, pagination, and retries\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1300-video",
   "metadata": {},
   "source": [
    "<h2>Video</h2>\n",
    "\n",
    "This overview introduces HTTP requests in Python, including reading JSON data from web responses.\n",
    "\n",
    "```{raw} html\n",
    "<iframe width=\"100%\" height=\"400\" src=\"https://www.youtube-nocookie.com/embed/tb8gHvYlCFs\" title=\"Python Requests Tutorial: Request Web Pages, Download Images, POST Data, Read JSON, and More\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "```\n",
    "\n",
    "> *[Python Requests Tutorial: Request Web Pages, Download Images, POST Data, Read JSON, and More](https://youtube.com/watch?v=tb8gHvYlCFs) by Corey Schafer*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch13-goals",
   "metadata": {},
   "source": [
    "<h2>Learning Goals</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Explain what an API is and how REST APIs communicate over HTTP\n",
    "2. Use the `requests` library to make GET requests and inspect responses\n",
    "3. Parse JSON responses into Python dictionaries and lists\n",
    "4. Pass query parameters to filter or configure API responses\n",
    "5. Handle HTTP errors and request exceptions gracefully\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch13-flow",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1300-slides",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" style=\"color: var(--pst-color-link, #176de8);\">Chapter Overview Slides</a></h2>"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
