๐ช Server (The Kitchen)
The actual machine running the code. It stores your data and does the work โ but you can't talk to it directly.
๐ API (The Menu)
A set of rules and endpoints that define what youโre allowed to ask the kitchen to do.
๐งพ Endpoints (Like a ticket printer at a kitchen station)
Think of these as the addresses for different kitchen stations โ the grill, the fryers, the sauce line, the dish pit โ where your requests get sent and processed.
๐ Rules (How you ask the kitchen staff for what you need)
You canโt just yell into the kitchen. The API expects very specific behavior:
What methods to use
GET
โ read somethingPOST
โ create somethingPATCH
โ update somethingDELETE
โ remove something
What data format is expected
(You canโt just use any method at any endpoint.)
Usually JSON.
Your request must be structured just right โ like using the correct key names, data types, and nesting.
What authentication is required
Many endpoints require an API token, sent in a header like Authorization: Bearer YOUR_TOKEN
.
Rate limits
Only a certain number of requests per minute/hour โ otherwise the kitchen throws you out.
Error handling
Youโll get error codes like 403 Forbidden
, 404 Not Found
, or 429 Too Many Requests
if something goes wrong.
๐คต SDK (The Waiter)
A friendly helper (i.e., a software development kit) who knows how to speak to both you (as a dev) and the kitchen (the server).
Instead of shouting raw HTTP requests, you just ask nicely in Python and let the SDK translate it.
๐ชช Authentication Token (The Membership Card)
โIโm allowed to be here โ and hereโs what Iโm allowed to order.โ
Your token proves your identity and permissions. Without it, youโre not getting served.
๐ก You need an auth token to access private endpoints, and to authenticate yourself for some public ones too.
๐ Private APIs / Endpoints
๐งโโ๏ธ A VIP club at the top of a skyscraper โ no token, no entry.
Example: Accessing your Notion workspace data.
๐ Public APIs / Endpoints
๐ A regular restaurant โ some info is available to anyone, but the best stuff still requires a reservation.
Example: GitHubโs public API lets you view user profiles, but limits how often and what you can do without authenticating.
Maybe you only have access to the salad bar. Or maybe youโre platinum and can order off the secret menu.
๐คตโโ๏ธ Client (Your Waiter)
Your personal instance of the SDK โ the one assigned to your table.
You give them your auth token (membership card), and they handle every order for you.
๐ญ Hereโs how the interaction starts:
Step 1: You introduce yourself
waiter = Client(auth=notion_token)
๐ฃ๏ธ You say:
โHi, Iโve got a reservation. Hereโs my membership card. Iโll be ordering shortly.โ
The waiter nods, tucks your card in their pocket, and prepares to serve.
Step 2: You place your order
waiter.pages.retrieve(page_id="...")
๐ฃ๏ธ Now you say:
โOne Notion page, please โ page ID 12345. Light on the 404s.โ
The waiter formats the request, sends it to the right kitchen station (endpoint), and returns exactly what you asked for.