Wrapped Lists#
Some APIs return JSON like this:
{ "items": [ { "title": "First review" }, { "title": "Second review" } ]}The list is not the whole response. It lives inside items.
Use path="items" to fetch that list:
{{ fetch "https://api.example.com/reviews" path="items" }} <article>{{ title }}</article>{{ /fetch }}Deeper Paths#
For deeper JSON, separate keys with dots:
{ "data": { "items": [ { "title": "First review" } ] }}{{ fetch "https://api.example.com/reviews" path="data.items" }} <article>{{ title }}</article>{{ /fetch }}What Path Selects#
path chooses the JSON value that the fetch block should render.
If the path points to a list, the block repeats for each item. If it points to one object, the block renders once. If the path does not exist, the fetch block is empty.