Back to Tool
💻

Code Snippet Share API

Create shareable code snippets with syntax highlighting via API

Endpoint

POST/api/v1/code-snippet-share

Authentication

Include your API key in the request header:

X-API-Key: your_api_key_here

Get your API key from the Dashboard

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
codestringYesCode content to share (max 100,000 characters)
languagestringYesProgramming language (javascript, python, java, etc.)
titlestringNoTitle for the snippet (max 100 characters)
expirystringNoExpiry time: "1h", "24h", "7d", "30d", "never" (default: "24h")

Response

FieldTypeDescription
successbooleanWhether the operation was successful
idstringUnique share ID
urlstringRelative URL to the share
fullUrlstringFull URL to the share
languagestringDetected/specified programming language
expiresAtstringISO timestamp when the share expires (null if never)

Code Examples

curl -X POST https://tools.shubhambadgujar.com/api/v1/code-snippet-share \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "function hello() {\n  console.log("Hello World");\n}",
    "language": "javascript",
    "title": "Hello World Example",
    "expiry": "7d"
  }'

Pricing

First 50 free, then $0.01 per call

Get API Key

Rate Limits

  • • 100 requests per minute
  • • 10,000 requests per day
  • • Max request size: 10MB

Need Help?

Contact us at support@shubhambadgujar.com