Fetch and display data from external APIs. What can load remote JSON data and make it available in your templates.
Random facts about dogs from the Dog API.
// Dog API endpoint
GET https://dogapi.dog/api/v2/facts?limit=3
// Response structure
{
"data": [
{
"attributes": {
"body": "Fact text here..."
}
}
]
}
Browse dog breeds with details like lifespan, weight, and characteristics.
// Paginated API request
GET https://dogapi.dog/api/v2/breeds
?page[number]=1
&page[size]=6
// Response includes pagination meta
{
"data": [...],
"meta": {
"pagination": {
"current_page": 1,
"total_pages": 10,
"total_count": 60
}
}
}
Random dog images from Dog CEO API.
// Dog CEO API endpoint
GET https://dog.ceo/api/breeds/image/random/4
// Response structure
{
"message": [
"https://images.dog.ceo/...",
"https://images.dog.ceo/...",
"https://images.dog.ceo/...",
"https://images.dog.ceo/..."
],
"status": "success"
}
Find more free APIs to use in your projects.
<!-- Fetch data in What templates -->
<what>
fetch.dogs = "https://dogapi.dog/api/v2/breeds"
</what>
<loop data="#dogs.data#" as="breed">
<h3>#breed.attributes.name#</h3>
</loop>