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 CaseDescriptionBest For
PrototypingQuickly create mock data for frontend development without backend setupEarly development, MVPs, proof of concepts
Configuration FilesStore application configurations that can be fetched at runtimeApp settings, feature flags, dynamic configs
TestingCreate test datasets for automated testing and QA environmentsUnit tests, integration tests, test fixtures
Data SharingShare structured data with team members or clients via public URLsCollaboration, demos, data exchange
Static ContentServe static JSON content for websites and applications via CDNProduct catalogs, content feeds, API responses
Documentation ExamplesProvide live data examples in API documentation and tutorialsDeveloper docs, educational content, examples

Creating a JSON Bin

Via Dashboard

  1. Sign in to your APIVerve Dashboard
  2. Navigate to VerveKit → JSON Bin
  3. Click "Create New Bin"
  4. Enter a descriptive name for your bin
  5. Paste or type your JSON data in the editor
  6. 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

Example JSON
{
  "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:

Endpoint URL
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
Authentication Header
x-api-key: YOUR_API_KEY

Response Format

The API returns your JSON data directly (not wrapped in a response envelope):

Response
{
  "users": [...],
  "settings": {...}
}

Code Examples

cURL

cURL Request
curl "https://api.apiverve.com/v1/jsonbin/abc123" \
  -H "x-api-key: YOUR_API_KEY"

JavaScript (Fetch API)

JavaScript (Fetch)
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)

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)

Python
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)

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
<?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

  1. Navigate to the JSON Bin section in your dashboard
  2. Click the Edit button next to your bin
  3. Modify your JSON data in the editor
  4. 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

  1. Navigate to the JSON Bin section in your dashboard
  2. Click the Delete button next to your bin
  3. 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:

Error Response
{
  "status": "error",
  "error": "Bin ID is required"
}

404 Not Found

Bin does not exist:

Error Response
{
  "status": "error",
  "error": "JSON bin not found"
}

429 Too Many Requests

Free plan daily limit exceeded:

Error Response
{
  "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:

Error Response
{
  "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