SHORT.BID API

Complete API Reference for Link Management and Premium Features

Version 1.0 | RESTful JSON API

Table of Contents

Authentication

The SHORT.BID API supports two authentication methods:

1. API Key Authentication (Recommended)

Include your API key in the request header:

X-API-Key: your_api_key_here

Or as a Bearer token:

Authorization: Bearer your_api_key_here

2. Cookie Authentication

If you're authenticated via the web interface, requests will automatically use your session cookie.

Generate API Key

POST /api.php

Request:

{ "action": "generateApiKey" }

Response:

{ "success": true, "apiKey": "abc123...", "message": "API key generated successfully. Keep it secure!" }
Important: Keep your API key secure! It provides full access to your account. Never share it or commit it to public repositories.

Base URL

https://short.bid/api.php

All endpoints accept JSON in the request body and return JSON responses.

Bulk Operations PREMIUM ONLY

Bulk operations allow you to update or delete multiple links at once. Premium subscription required.

POST Bulk Update Links PREMIUM

Action: bulkUpdate

Description: Update multiple links at once

Parameters:

Parameter Type Required Description
linkIds array Yes Array of link IDs to update
updates object Yes Object containing fields to update

Example: Set all links to no-referer

{ "action": "bulkUpdate", "linkIds": [1, 2, 3, 4, 5], "updates": { "linkNoReferer": 1 } }

Example: Change domain for multiple links

{ "action": "bulkUpdate", "linkIds": [10, 20, 30], "updates": { "linkCustomDomain": "custom.example.com" } }

Example: Set multiple links to POST method

{ "action": "bulkUpdate", "linkIds": [7, 8, 9], "updates": { "linkPostMethod": 1 } }

Example Response:

{ "success": true, "message": "Bulk update completed", "updated": 5, "total": 5 }
DELETE Bulk Delete Links PREMIUM

Action: bulkDelete

Description: Delete multiple links at once

Parameters:

Parameter Type Required Description
linkIds array Yes Array of link IDs to delete

Example Request:

{ "action": "bulkDelete", "linkIds": [1, 2, 3, 4, 5] }

Example Response:

{ "success": true, "message": "Bulk delete completed", "deleted": 5, "total": 5 }

User & Statistics

GET Get Statistics

Action: getStats

Description: Get your account statistics

Example Request:

{ "action": "getStats" }

Example Response:

{ "success": true, "stats": { "monthlyTraffic": 1250, "totalTraffic": 15420, "totalLinks": 42, "isPremium": true, "subscription": { "planName": "Premium Annual", "planSlug": "premium-annual", "subscriptionStatus": "active" } } }
GET Get User Info

Action: getUser

Description: Get your user account information

Example Request:

{ "action": "getUser" }

Example Response:

{ "success": true, "user": { "userId": 1, "userEmail": "user@example.com", "isPremium": true, "subscription": { "planName": "Premium Annual", "subscriptionStatus": "active" } } }

Error Handling

All errors return a JSON response with an error field:

HTTP Code Description Example
400 Bad Request Missing required parameters
401 Unauthorized Invalid or missing API key
403 Forbidden Premium feature requires subscription
404 Not Found Link not found or access denied

Example Error Response:

{ "error": "Authentication required. Please provide API key or login." }

Code Examples

cURL

curl -X POST https://short.bid/api.php \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "action": "createLink", "url": "https://example.com", "noReferer": 1 }'

JavaScript (Fetch API)

fetch('https://short.bid/api.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key_here' }, body: JSON.stringify({ action: 'createLink', url: 'https://example.com', noReferer: 1 }) }) .then(response => response.json()) .then(data => console.log(data));

Python (requests)

import requests headers = { 'X-API-Key': 'your_api_key_here', 'Content-Type': 'application/json' } data = { 'action': 'createLink', 'url': 'https://example.com', 'noReferer': 1 } response = requests.post( 'https://short.bid/api.php', headers=headers, json=data ) print(response.json())

PHP

$ch = curl_init('https://short.bid/api.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-API-Key: your_api_key_here', 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'action' => 'createLink', 'url' => 'https://example.com', 'noReferer' => 1 ])); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); print_r($data);

Rate Limits

Currently, there are no enforced rate limits, but please use the API responsibly.

If abuse is detected, rate limiting may be implemented in the future.

Support

For API support or questions, please contact us at info@short.bid

Premium users receive priority support for API-related issues.