API Design · Junior · Question 72 of 75

Why do many APIs return { "data": [...] } instead of a bare JSON array for lists?

Explanation

Top-level arrays can't be extended. An object wrapper keeps room for metadata.

Further reading

Problem with a question

API Design · Junior · question 72

Test yourself

Take the API Design · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz