Advertisement
ADVERTISEMENT

Pastebin API

Developer API

Pastebin API for Developers

Automate paste creation and management with the GistPad API. Create shareable pastes from your applications, scripts, CI workflows and developer tools without having to create each paste manually.

The API supports API-key authentication, paste visibility, expiration, syntax highlighting, categories, folders and other paste-management operations.

API KEY
Authenticated API access for developers.
CREATE
Create pastes directly from your code.
CONTROL
Set visibility, expiration and syntax.
MANAGE
List and delete pastes created through the API.

What is a Pastebin API?

A Pastebin API allows developers to create and manage text or code pastes programmatically instead of using a web form. This is useful when your application, script or automation needs to generate a paste and receive a shareable URL automatically.

GistPad provides an API designed around this workflow, making it possible to integrate paste sharing into developer tools, automation scripts, debugging workflows and other applications.

Create a Paste with the API

To create a new paste, send a POST request to:

https://gistpad.com/api/paste/create

Requests use the X-API-KEY header for authentication and send the paste content as part of the request.

cURL Example

A simple cURL request can create a new paste and return the resulting paste URL.

curl --location 'https://gistpad.com/api/paste/create' \
--header 'Accept: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--form 'content="Hello from the GistPad API"' \
--form 'status="0"' \
--form 'expire="N"' \
--form 'title="API Test Paste"'

PHP Example

The API can also be integrated directly into PHP applications using cURL.

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://gistpad.com/api/paste/create',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => [
        'content' => 'Hello from PHP',
        'status' => '0',
        'expire' => 'N',
        'title' => 'PHP API Example'
    ],
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'X-API-KEY: YOUR_API_KEY'
    ],
]);

$response = curl_exec($curl);

curl_close($curl);

echo $response;

API Parameters

Parameter Purpose
X-API-KEY Your developer API key, sent in the request header.
content The text or code that will be stored in the paste.
title Optional title for the paste.
status Controls visibility: Public, Unlisted or Private.
expire Controls how long the paste remains available.
syntax_id Selects the syntax highlighting language.
category_id Assigns a supported paste category.
password Optional password protection for a paste.

Paste Visibility

Your application can control the visibility of a paste with the status parameter.

Public Visible to everyone.
Unlisted Accessible through the paste link.
Private Restricted to the authenticated account.

Paste Expiration

GistPad supports several expiration values through the API, including temporary expiration and a never-expire option.

Value Duration
10M 10 Minutes
1H 1 Hour
1D 1 Day
1W 1 Week
2W 2 Weeks
1M 1 Month
6M 6 Months
1Y 1 Year
N Never
B Burn After Read

A Simple API Workflow

01
Get an API Key Log in or create an account and obtain your developer API key.
02
Send a Request POST your content and optional paste settings to the API.
03
Receive the URL A successful request returns the paste slug and shareable URL.
04
Manage It Use the available API endpoints to manage your API-created pastes.

What Can You Build With a Pastebin API?

Debugging Tools Automatically publish error output, logs or diagnostic information as a shareable paste.
CLI Utilities Create pastes directly from shell scripts and command-line workflows.
CI/CD Workflows Publish selected build output or temporary diagnostic information during automated workflows.
Developer Integrations Connect paste creation to internal tools, scripts, dashboards and other applications.
Support Workflows Generate temporary links for logs or technical information that needs to be shared quickly.
Automation Use an API instead of manually copying content into a web-based paste form.

Other GistPad API Endpoints

GistPad's developer documentation also lists endpoints for additional operations, including listing API-created pastes, deleting pastes, updating pastes and working with raw paste content.

https://gistpad.com/api/my-pastes
https://gistpad.com/api/paste/delete
https://gistpad.com/api/paste/update
https://gistpad.com/api/raw/paste-slug
https://gistpad.com/api/search
https://gistpad.com/api/trending

Protect Your API Key

Treat your API key like a credential. Do not publish it inside client-side JavaScript, public repositories or publicly accessible configuration files.

Keep the key on the server side whenever possible and avoid exposing it in application logs or publicly shared code.

Pastebin API FAQ

Does GistPad have a Pastebin API?
Yes. GistPad provides a developer API for creating and managing pastes programmatically.
Do I need an API key?
Yes. GistPad's API documentation requires a valid developer API key for API access.
Can I create pastes automatically?
Yes. You can send a POST request to the paste creation endpoint and receive a paste slug and shareable URL in the successful response.
Can I set paste expiration through the API?
Yes. The API supports multiple expiration values, including minutes, hours, days, weeks, months, one year, never-expire and Burn After Read.
Can I control paste visibility?
Yes. The API supports Public, Unlisted and Private paste status values.
Where can I find the complete documentation?
The complete API documentation is available at gistpad.com/api_doc .

Related GistPad Pages

Start Building With the GistPad API

Connect paste sharing to your applications, automation and developer workflows. Read the documentation and start creating pastes programmatically.

Explore the API Documentation
Advertisement
Advertisement