JSON Bin
Store and serve JSON data through public CDN endpoints. JSON Bin provides a simple way to host JSON data without setting up a database, perfect for prototyping, testing, and configuration storage.
Quick Access: Manage your JSON bins in the VerveKit Dashboard.
Features
- CDN Delivery: Your JSON data is served via Google Cloud Storage CDN for fast, reliable global access
- No Setup: No database configuration or backend code required
- Simple API: Access your data with a single GET request
- Usage Analytics: Track access counts and monitor usage patterns
- Secure Storage: Data encrypted at rest and in transit
- Size Limit: Up to 1MB per bin
Use Cases
| Use Case | Description | Best For |
|---|---|---|
| Prototyping | Quickly create mock data for frontend development without backend setup | Early development, MVPs, proof of concepts |
| Configuration Files | Store application configurations that can be fetched at runtime | App settings, feature flags, dynamic configs |
| Testing | Create test datasets for automated testing and QA environments | Unit tests, integration tests, test fixtures |
| Data Sharing | Share structured data with team members or clients via public URLs | Collaboration, demos, data exchange |
| Static Content | Serve static JSON content for websites and applications via CDN | Product catalogs, content feeds, API responses |
| Documentation Examples | Provide live data examples in API documentation and tutorials | Developer docs, educational content, examples |
Creating a JSON Bin
Via Dashboard
- Sign in to your APIVerve Dashboard
- Navigate to VerveKit → JSON Bin
- Click "Create New Bin"
- Enter a descriptive name for your bin
- Paste or type your JSON data in the editor
- Click "Save" to create your bin
JSON Validation: Your data will be validated before saving. Ensure it's valid JSON format. Use tools like JSONLint to validate beforehand.
Example JSON Data
{
"users": [
{
"id": 1,
"name": "John Doe",
"email": "[email protected]",
"role": "admin"
},
{
"id": 2,
"name": "Jane Smith",
"email": "[email protected]",
"role": "user"
}
],
"settings": {
"theme": "dark",
"language": "en",
"notifications": true
}
}Accessing Your Data
Once created, your JSON bin is immediately available via a public URL. The endpoint format is:
https://api.apiverve.com/v1/jsonbin/{binId}Finding Your Bin ID: The bin ID is displayed in your dashboard after creation. You can also copy the complete URL directly from the dashboard.
HTTP Method
JSON Bin only supports the GET method for retrieving data.
Authentication
Include your API key in the request header:
- Header:
x-api-key - Location: HTTP headers
- Required: Yes
x-api-key: YOUR_API_KEYResponse Format
The API returns your JSON data directly (not wrapped in a response envelope):
{
"users": [...],
"settings": {...}
}Code Examples
cURL
curl "https://api.apiverve.com/v1/jsonbin/abc123" \
-H "x-api-key: YOUR_API_KEY"JavaScript (Fetch API)
const apiKey = 'YOUR_API_KEY';
const binId = 'abc123';
fetch(`https://api.apiverve.com/v1/jsonbin/${binId}`, {
headers: {
'x-api-key': apiKey
}
})
.then(response => response.json())
.then(data => {
console.log('JSON Data:', data);
// Use your data here
})
.catch(error => {
console.error('Error:', error);
});JavaScript (Async/Await)
async function getJsonBin(binId) {
const apiKey = 'YOUR_API_KEY';
const url = `https://api.apiverve.com/v1/jsonbin/${binId}`;
try {
const response = await fetch(url, {
headers: {
'x-api-key': apiKey
}
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching JSON bin:', error);
throw error;
}
}
// Usage
getJsonBin('abc123')
.then(data => console.log(data))
.catch(error => console.error(error));Python (requests)
import requests
api_key = 'YOUR_API_KEY'
bin_id = 'abc123'
url = f'https://api.apiverve.com/v1/jsonbin/{bin_id}'
headers = {'x-api-key': api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print('JSON Data:', data)
else:
print(f'Error: {response.status_code}')
print(response.text)Node.js (axios)
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const binId = 'abc123';
axios.get(`https://api.apiverve.com/v1/jsonbin/${binId}`, {
headers: { 'x-api-key': apiKey }
})
.then(response => {
console.log('JSON Data:', response.data);
})
.catch(error => {
console.error('Error:', error.message);
});PHP
<?php
$apiKey = 'YOUR_API_KEY';
$binId = 'abc123';
$url = "https://api.apiverve.com/v1/jsonbin/{$binId}";
$options = [
'http' => [
'header' => "x-api-key: {$apiKey}\r\n"
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
if ($response !== false) {
$data = json_decode($response, true);
print_r($data);
} else {
echo "Error fetching data";
}
?>Rate Limits & Pricing
Free Plan
- Daily Limit: 100 requests per bin per day
- Reset: Daily at midnight UTC
- Storage: Unlimited bins, 1MB per bin max
Paid Plans
- Requests: Unlimited (based on your API token balance)
- Token Cost: Requests do NOT consume tokens (only monitoring does)
- Storage: Unlimited bins, 1MB per bin max
Optimize Access: For high-traffic applications on the free plan, consider caching responses in your application to reduce requests.
Managing Your Bins
All JSON bin management is done through the dashboard:
Edit Bin
- Navigate to the JSON Bin section in your dashboard
- Click the Edit button next to your bin
- Modify your JSON data in the editor
- Click Save to update
URL Persistence: Editing a bin does NOT change its URL. Your existing integrations will automatically receive the updated data.
Delete Bin
- Navigate to the JSON Bin section in your dashboard
- Click the Delete button next to your bin
- Confirm the deletion
Permanent Action: Deleting a bin is permanent and cannot be undone. The URL will no longer be accessible.
View Analytics
Track usage metrics for each bin:
- Total Access Count: Total number of requests
- Daily Access Count: Requests today (for free plan tracking)
- Creation Date: When the bin was created
- Last Modified: When the data was last updated
Error Responses
400 Bad Request
Bin ID is missing or invalid:
{
"status": "error",
"error": "Bin ID is required"
}404 Not Found
Bin does not exist:
{
"status": "error",
"error": "JSON bin not found"
}429 Too Many Requests
Free plan daily limit exceeded:
{
"status": "error",
"error": "Daily access limit exceeded (100 requests per day for free plan)",
"requiresUpgrade": true
}500 Internal Server Error
Service configuration or storage error:
{
"status": "error",
"error": "Failed to fetch bin content"
}Best Practices
- Size Limit: Keep individual bins under 1MB for optimal performance
- Naming: Use descriptive names to organize your bins effectively
- Security: Do not store sensitive data - bins are publicly accessible with API key
- Caching: Implement client-side caching to reduce requests and improve performance
- Validation: Validate JSON locally before uploading to avoid errors
- Error Handling: Always implement proper error handling in your code
- Monitoring: Regularly check your usage analytics to optimize access patterns
Performance Tip: For frequently accessed data, set appropriate cache headers in your application to reduce redundant requests.
Need Help?
Was this page helpful?
Help us improve our documentation