Specra Format Example
Live API example using Specra format with JSONPlaceholder
This page demonstrates the <ApiReference> component using a real public API (JSONPlaceholder).
All endpoints below are fully functional and can be tested using the interactive playground!
Info
This API is free and requires no authentication. Perfect for testing!
Loading API specification...
Try It Yourself
- Expand any endpoint by clicking on it
- Scroll to the playground at the bottom of each endpoint
- Click "Send Request" to test the API live
- View the response in the JSON viewer
About JSONPlaceholder
JSONPlaceholder is a free fake REST API for testing and prototyping. It's perfect for:
- Testing API documentation tools (like this!)
- Frontend development
- Learning HTTP methods
- Prototyping applications
Pro Tip
Try modifying the request body in the POST/PUT/PATCH endpoints and see the response change!
Example Integration
Here's how you might use this API in a real application:
javascript
1// Fetch all posts2async function getPosts() {3 const response = await fetch('https://jsonplaceholder.typicode.com/posts?_limit=5');4 const posts = await response.json();5 return posts;6}7 8// Create a new post9async function createPost(title, body) {10 const response = await fetch('https://jsonplaceholder.typicode.com/posts', {11 method: 'POST',12 headers: { 'Content-Type': 'application/json' },13 body: JSON.stringify({14 title,15 body,16 userId: 117 })18 });19 return await response.json();20}21 22// Usage23const posts = await getPosts();24console.log(posts);25 26const newPost = await createPost('My Title', 'My Content');27console.log(newPost);Next Steps
- Check out the manual API documentation example
- Learn about creating your own API spec
- Read the full API Documentation Guide