URLs and Resources

View saved

Nouns in the path

Prefer /books/42 over /getBook?id=42. Collections are plural nouns; items include an id.

GET /api/books
GET /api/books/42
GET /api/books/42/reviews

Query strings for filters

Use the path for identity; use query parameters for sorting, filtering, and search.

GET /api/books?author=Ada&sort=year

Nesting depth

One level of nesting is often enough (/users/3/orders). Deep trees become awkward—prefer links or filters when relationships grow.

Consistency beats cleverness

Pick naming rules (kebab-case vs snake_case, plurals) and stick to them across the API.

Comments

One comment per signed-in account. Comments are saved with this page’s URL.