E-Z LogoE-Z Wiki

Paste API

Create text pastes with syntax highlighting support using the E-Z.host paste service.

Endpoint

POST /paste

Headers

HeaderValueDescription
Content-Typeapplication/jsonThe type of the request body
keyYOUR_API_KEYYour API key for authentication

Request Body

JSON object with the following fields:

FieldTypeRequiredDescription
textstringYesThe content of the paste
titlestringYesTitle for the paste
descriptionstringYesDescription for the paste
languagestringYesProgramming language for syntax highlighting

Example Request Body

{
  "text": "console.log('Hello, World!');",
  "title": "My JavaScript Code",
  "description": "A simple hello world app",
  "language": "javascript"
}

Example Request

curl -X POST https://api.e-z.host/paste \
  -H 'Content-Type: application/json' \
  -H 'key: YOUR_API_KEY' \
  -d '{
    "text": "console.log(\"Hello, World!\");",
    "title": "My JavaScript Code",
    "description": "A simple hello world app",
    "language": "javascript"
  }'

Response

Success Response

{
  "success": true,
  "message": "Paste Created",
  "pasteUrl": "https://hentai.expert/p/i7msws0v",
  "rawUrl": "https://hentai.expert/p/raw/i7msws0v",
  "deletionUrl": "https://api.e-z.host/paste/delete?key=random-deletion-key"
}

Response Fields

FieldDescription
successBoolean indicating if the request was successful
messageStatus message
pasteUrlURL to view the paste with syntax highlighting
rawUrlURL to view the raw paste content
deletionUrlURL to delete the paste

Error Handling

Common error responses:

  • 400 Bad Request: Invalid input format
  • 401 Unauthorized: Invalid or missing API key
  • 422 Unprocessable Entity: Validation error due to missing or invalid parameters
  • 429 Too Many Requests: Rate limit exceeded (3 requests per 15 seconds)

Error Response Format

{
  "success": false,
  "error": "Error description"
}

Rate Limiting

This endpoint is subject to the global rate limit of 3 requests per 15 seconds per API key.

Supported Languages

E-Z.host supports syntax highlighting for many programming languages including:

  • JavaScript
  • Python
  • Java
  • C++
  • HTML
  • CSS
  • And many more...

Need Help?

If you need assistance with the paste API: