API Mastery: You Are the Frontend
The Paradigm Shift
Stop clicking through UIs. Become the frontend.
| Old Way | New Way |
|---|---|
Click through forms |
|
Wait for page loads |
Instant JSON response |
Limited by UI design |
Full data access |
Manual repetitive tasks |
Scripted automation |
One operation at a time |
Bulk operations |
The Toolkit
| Tool | Purpose | Example |
|---|---|---|
|
HTTP requests |
|
|
JSON parsing |
|
|
YAML parsing |
|
DevTools |
Reverse-engineer APIs |
|
|
curl alternatives |
|
The Workflow
Every system with a web UI has an API behind it. Your workflow:
1. Open DevTools (F12) → Network tab
2. Use the UI normally, watch requests appear
3. Right-click request → Copy as cURL
4. Paste in terminal, pipe to jq
5. Build reusable shell functions
Quick Start
Test your setup:
# Fetch public API, parse with jq
curl -s https://jsonplaceholder.typicode.com/users/1 | jq
# Extract specific field
curl -s https://jsonplaceholder.typicode.com/users/1 | jq -r '.email'
# Filter array
curl -s https://jsonplaceholder.typicode.com/users | jq '.[] | {name, email}'
Learning Path
| Module | Description |
|---|---|
HTTP methods, headers, status codes |
|
Reverse-engineering any web app |
|
Flags, authentication, file uploads |
|
Bearer tokens, API keys, OAuth, cookies |
|
Complex data transformations |
|
Functions, gopass, automation |
Practice APIs
| API | URL | Auth Required |
|---|---|---|
jsonplaceholder.typicode.com |
No |
|
httpbin.org |
No |
|
api.github.com |
Optional |
|
pokeapi.co/api/v2 |
No |
The Endgame
# Your custom CLI for any system
myapp() {
curl -s "https://api.myapp.com/$1" \
-H "Authorization: Bearer $(gopass show v3/work/myapp | sed '1,/^---$/d' | yq -r '.api_key')" \
| jq "${2:-.}"
}
# Usage
myapp users # List all users
myapp users '.[] | .email' # Just emails
myapp tickets/123 # Specific resource
myapp tickets '.[0:5]' # First 5
You are now faster than any UI. You can automate. You can bulk operate. You are the frontend.