What is a URL, really?
Every URL is a structured address — learn to read it
⏱ Est. ~4 min
01 · Read
You've been clicking URLs your whole life. But as an engineer, you need to read them — not just click them.
Every URL is built from different parts, and each part has a specific meaning. Once you can break down a URL, you can figure out any API, debug any request, and build any network feature.
💡 Picture thisA URL is like a mailing address. The protocol is the shipping method (air vs ground), the host is the street address, the path is the apartment number, and the query string is a sticky note on the envelope with extra instructions.
Key points
- URLs are structured — each part has a name and a purpose
- The query string (?key=value) is how you pass optional parameters
- A path like /users/42 means "resource users, item 42"
- The same host can have thousands of different paths
02 · Code example
Let's break a real URL into its parts.
Full URL
https://api.github.com/users/torvalds/repos?per_page=5&sort=updated
Protocol
https://
"How to talk" — encrypted HTTP connection.
Always https:// for real APIs (not http://).
Host
api.github.com
"Who to talk to" — the server's address on the internet.
DNS translates this to an IP like 140.82.121.6.
Path
/users/torvalds/repos
"What to ask for" — the specific resource on that server.
Like a file path, but for API resources.
Query String
?per_page=5&sort=updated
"Extra options" — key=value pairs after the ?.
per_page=5 means "give me 5 results".
sort=updated means "sort by last updated".
The ? marks the start of the query string. Each parameter is key=value. Multiple parameters are separated by &. The server reads each one as an option or a filter.
03 · Drag to sort
Figure out the correct part for each URL fragment below.
(This section is interactive — please enable JavaScript.)
04 · Quiz
In the URL https://api.example.com/products?category=shoes&limit=20, what does limit=20 do?
- Connects to port 20 on the server
- Passes 'limit' as a query parameter with the value '20' — the server decides how to handle it
- Limits the server's CPU usage to 20%
- Sets the URL's maximum length to 20 characters
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.