🎯 Getting Started
Quick Setup
npm install colorful-api
# or
yarn add colorful-api
Basic Configuration
import { ColorfulAPI } from 'colorful-api';
const api = new ColorfulAPI({
apiKey: 'your-api-key-here',
environment: 'production'
});
🔐 Authentication
API Keys
Get your API key from the dashboard and include it in your requests:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.colorful.dev/v1/users
📡 Endpoints
GET
/v1/users
Retrieve a list of users
{
"users": [
{
"id": "123",
"name": "Alice",
"email": "alice@example.com"
}
]
}
POST
/v1/users
Create a new user
{
"name": "Bob",
"email": "bob@example.com",
"role": "developer"
}
💡 Examples
JavaScript Example
async function fetchUsers() {
const response = await fetch('/v1/users', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
return await response.json();
}
Python Example
import requests
response = requests.get(
'https://api.colorful.dev/v1/users',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
users = response.json()