cURL
curl --request GET \ --url https://jotihunt.nl/api/2.0/articles
{ "data": [ { "id": 123, "title": "<string>", "type": "news", "publish_at": "2023-11-07T05:31:56Z", "message": { "content": "<string>" } } ], "links": { "first": "<string>", "last": "<string>", "prev": "<string>", "next": "<string>" }, "meta": { "current_page": 123, "from": 123, "last_page": 123, "links": [ { "url": "<string>", "label": "<string>", "active": true } ], "path": "<string>", "per_page": 123, "to": 123, "total": 123 } }
Returns articles with pagination
/articles
// Using fetch to retrieve all published articles fetch('https://jotihunt.nl/api/articles') .then(response => response.json()) .then(data => { console.log('Articles:', data); // Process articles - e.g., display the most recent ones const recentArticles = data.slice(0, 5); recentArticles.forEach(article => { console.log(`${article.title} - ${article.publish_at}`); }); }) .catch(error => { console.error('Error fetching articles:', error); });
Page number for pagination
Number of articles per page
Articles response with pagination
Show child attributes
Was this page helpful?