
Documentation
Learn how to use Spineless API to accelerate your frontend development workflow.
Getting Started with Spineless API
Spineless API helps you create realistic mock APIs to accelerate your frontend development. Follow these steps to get started:
Create an Account
Sign up for a free Spineless API account to get access to the platform. You'll need to provide your email and create a password.
Create Your First API
After logging in, navigate to the dashboard and click "Create New API". You'll need to provide a name, description, and schema for your API.
Define Your Schema
Use our schema editor to define the structure of your API response. You can specify data types, constraints, and relationships.
Generate and Test
Once your schema is defined, click "Generate" to create your mock API. You'll get a unique endpoint URL that you can use in your frontend application.
API Creation Guide
Learn how to create effective API schemas that generate realistic mock data.
Schema Structure
A Spineless API schema consists of a JSON object with the following properties:
{ "property": "data_type", // Simple property "object": { // Nested object "property": "data_type" }, "array": [ // Array of items { "property": "data_type" } ] }, "count": number // For arrays, how many items to generate
Supported Data Types
Spineless API supports the following data types:
- string: A basic string value
- string:name: A realistic person name
- string:email: A valid email address
- string:uuid: A UUID string
- string:enum:value1,value2: One of the provided values
- number: A random number
- number:integer: A random integer
- number:range:min,max: A number within the specified range
- boolean: A random boolean value
- date: A random date in ISO format
- date:past: A date in the past
- date:future: A date in the future
Integrating with Your Application
Once you've created your mock API, it's time to integrate it with your frontend application.
Using Fetch API
Here's how to use the Fetch API to call your mock API:
fetch('https://spineless-api.app/mock/your-endpoint-id') .then(response => response.json()) .then(data => { console.log(data); // Use the data in your application }) .catch(error => { console.error('Error fetching data:', error); });
Advanced Features
Explore advanced features to get the most out of Spineless API.
Custom Response Headers
You can specify custom headers for your API responses by adding a headers object to your schema:
{ "data": { // Your regular schema here }, "headers": { "X-Custom-Header": "Custom Value", "Cache-Control": "max-age=3600" } }
Response Delay
Simulate network latency by adding a delay to your API responses:
{ "data": { // Your regular schema here }, "delay": 1500 // Delay in milliseconds }
Error Simulation
Test how your application handles errors by simulating error responses:
{ "error": { "status": 404, "message": "Resource not found" } }