The PasteJustit.com API allows developers to create, retrieve, update, and delete text and code snippets (pastes) programmatically. It provides an easy and flexible way to integrate snippet sharing into your applications. You can customize paste visibility and manage pastes with ease.
https://pastejustit.com/api
No authentication is required for public pastes. However, an API key is required to manage or create private pastes.
Include the following header in all authenticated requests:
x-api-key: your_api_key_here
You can generate an API key in your PasteJustit.com account dashboard.
Create a new paste with options for public, unlisted, or private visibility.
POST https://pastejustit.com/api/paste
Parameter | Type | Description |
---|---|---|
title | string | (Optional) Title of the paste |
content | string | The text or code snippet content |
visibility | string | public , unlisted , or private |
expires_in | string | (Optional) Expiration time in minutes |
{
"title": "Sample Paste",
"content": "console.log('Hello World!');",
"visibility": "public",
"expires_in": "1440"
}
{
"id": "abc123",
"url": "https://pastejustit.com/abc123",
"created_at": "2024-10-19T12:34:56Z",
"expires_in": "1440",
"visibility": "public"
}
Retrieve a paste by its unique ID.
GET https://pastejustit.com/api/paste/{paste_id}
GET https://pastejustit.com/api/paste/abc123
{
"id": "abc123",
"title": "Sample Paste",
"content": "console.log('Hello World!');",
"visibility": "public",
"created_at": "2024-10-19T12:34:56Z",
"expires_in": "1440"
}
Delete a specific paste using its ID. This action requires authentication.
DELETE https://pastejustit.com/api/paste/{paste_id}
DELETE https://pastejustit.com/api/paste/abc123
{
"message": "Paste successfully deleted."
}
Retrieve a list of all pastes created by the authenticated user.
GET https://pastejustit.com/api/pastes
GET https://pastejustit.com/api/pastes
[
{
"id": "abc123",
"title": "Sample Paste 1",
"url": "https://pastejustit.com/abc123",
"visibility": "public",
"created_at": "2024-10-19T12:34:56Z"
},
{
"id": "def456",
"title": "Sample Paste 2",
"url": "https://pastejustit.com/def456",
"visibility": "private",
"created_at": "2024-10-18T10:20:30Z"
}
]
Update an existing paste by its ID. Requires authentication.
PUT https://pastejustit.com/api/paste/{paste_id}
Parameter | Type | Description |
---|---|---|
title | string | (Optional) New title of the paste |
content | string | New text or code snippet content |
visibility | string | public , unlisted , or private |
expires_in | string | (Optional) New expiration time in minutes |
{
"title": "Updated Sample Paste",
"content": "console.log('Updated Hello World!');",
"visibility": "unlisted",
"expires_in": "2880"
}
{
"id": "abc123",
"url": "https://pastejustit.com/abc123",
"updated_at": "2024-10-19T13:45:23Z"
}
Search through public pastes using keywords or filter by programming language.
GET https://pastejustit.com/api/search
Parameter | Type | Description |
---|---|---|
query | string | The search term (required) |
language | string | Filter results by programming language (optional) |
GET https://pastejustit.com/api/search?query=console&language=javascript
[
{
"id": "ghi789",
"title": "Console Example",
"content": "console.log('Example');",
"language": "javascript",
"url": "https://pastejustit.com/ghi789"
}
]
Check the current rate limits for your API key to prevent exceeding the quota.
GET https://pastejustit.com/api/rate_limit
GET https://pastejustit.com/api/rate_limit
{
"rate_limit": 200,
"rate_limit_remaining": 150,
"rate_limit_reset": "2024-10-19T12:00:00Z"
}
The API will return standard HTTP status codes for errors:
{
"error": "Paste not found",
"status": 404
}
The PasteJustit.com API imposes rate limits to prevent abuse:
Rate limits reset every hour. If you exceed the limit, you will receive a 429 Too Many Requests
response.
With the PasteJustit.com API, you can seamlessly integrate snippet-sharing capabilities into your applications. Manage pastes programmatically with ease and enjoy features like customizable visibility, syntax highlighting, and more!