Developers API
This is the Fast Pastebin Alternative developers API documentation page. Here you can find all the information you need to get started with our API. If you have questions, feel free to Contact us.
- Your Unique Developer API Key
- Creating A New Paste
- Creating A New Paste, [Required Parameters]
- Creating A New Paste, [Optional Parameters]
- Creating A New Paste, The 'syntax_id' Parameter In Detail
- Creating A New Paste, The 'category_id' Parameter In Detail
- Creating A New Paste, The 'expire' Parameter In Detail
- Creating A New Paste, The 'status' Parameter In Detail
- Creating A New Paste, The 'folder_id' Parameter In Detail
- Listing Pastes Created By A User
- Deleting A Paste Created By A User
- Other API Endpoints
Your Unique Developer API Key
Everybody using our API is required to use a valid Developer API Key. You automatically get a key when you become a member of Fast Pastebin Alternative.
Creating A New Paste
Creating a new paste via our API is very easy. You simply have to send a valid POST request to the url shown below. Please make sure you are sending the data as the UTF-8 charset.
https://gistpad.com/api/paste/create
Below is a PHP example using curl how to create a new paste:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gistpad.com/api/paste/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('content' => 'this is new paste','status' => '1','expire' => 'N','title' => 'My Paste','syntax_id' => 1,'category_id' => 1,'password' => '12345'),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'X-API-KEY: XXXXXXXXXXXXXXXXXXXXXXXXX'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Below is a curl command example how to create a new paste:
curl --location 'https://gistpad.com/api/paste/create' \
--header 'Accept: application/json' \
--header 'X-API-KEY: XXXXXXXXXXXXXXXXXXXXXXXXX' \
--form 'content="this is new paste"' \
--form 'status="1"' \
--form 'expire="N"' \
--form 'title="My Paste"' \
--form 'syntax_id="1"' \
--form 'category_id="1"' \
--form 'folder_id="1"' \
--form 'password="12345"'
Possible Good API Responses: (example)
{
"success": {
"messages": "Paste successfully created",
"slug": "YvS0bRhQLK",
"paste_url": "https://gistpad.com/YvS0bRhQLK"
}
}
Possible Bad API Responses:
{
"message": "Unauthenticated."
}
{
"error": {
"content": ["The Content field is required."],
"status": ["The Status field is required."]
}
}
{
"error": "User pasting is currently disabled"
}
{
"error": "Public pasting is currently disabled please login to create a paste"
}
{
"error": "Max allowed content size is N kb"
}
{
"error": "Daily paste limit reached"
}
{
"error": "Please wait N minutes before making another paste"
}
{
"error": "Daily paste limit reached, Please login to increase your paste limit"
}
Creating A New Paste, [Required Parameters]
Include all the following POST parameters when you request the url:
- X-API-KEY (headers) - which is your unique API Developers Key.
- content - this is the text that will be written inside your paste.
Leaving any of these parameters out will result in an error.
Creating A New Paste, [Optional Parameters]
These parameters are not required when you create a new paste, but are possible to add:
- title - this will be the name / title of your paste.
- status - this is required parameter which makes paste public, unlisted or private, public = 0, unlisted = 1, private = 2
- syntax_id - this is optional parameter, value must be valid syntax id from given Archive List API
- category_id - this is optional parameter, value must be valid category id from given Category List API
- expire - this is optional parameter which makes it used to set expire time of paste.
- password - this is optional parameter which makes paste password protected.
- folder_id - this is optional parameter, value must be valid folder id from given my-folders API.
Creating A New Paste, The syntax_id Parameter In Detail
We have over 200 syntax highlighting options available. For the full list, refer to syntax highlights.
Creating A New Paste, The category_id Parameter In Detail
We have many categories available, below you can find a list of all the possible values you can use in combination with category_id:
- 5 = Cryptocurrency
- 4 = Cybersecurity
- 7 = Fixit
- 8 = Food
- 9 = Gaming
- 10 = Haiku
- 11 = Help
- 12 = History
- 13 = Housing
- 14 = Jokes
- 15 = Legal
- 16 = Money
- 6 = Movies
- 17 = Music
- 18 = Pets
- 19 = Photo
- 20 = Science
- 21 = Software
- 27 = Source Code
- 22 = Spirit
- 23 = Sports
- 24 = Travel
- 25 = TV
- 26 = Writing
Creating A New Paste, The expire Parameter In Detail
We have 9 valid values available which you can use with the api_paste_expire_date parameter:
- N = Never
- B = Burn After Read
- 10M = 10 Minutes
- 1H = 1 Hour
- 1D = 1 Day
- 1W = 1 Week
- 2W = 2 Weeks
- 1M = 1 Month
- 6M = 6 Months
- 1Y = 1 Year
Creating A New Paste, The status Parameter In Detail
We have 3 valid values available which you can use with the status parameter:
- 0 = Public
- 1 = Unlisted
- 2 = Private
Creating A New Paste, The folder_id Parameter In Detail
You can retrieve your folder's id with the following API endpoint:
https://gistpad.com/api/my-folders
Listing Pastes Created By A User
You can retrieve your pastes with the following API endpoint:
https://gistpad.com/api/my-pastes
Deleting A Paste Created By A User
You can delete your paste with the following API endpoint:
https://gistpad.com/api/paste/delete
Below is a PHP example using curl how to delete a paste:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gistpad.com/api/paste/delete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('id' => '1'),
CURLOPT_HTTPHEADER => array(
'X-API-KEY: XXXXXXXXXXXXXXXXXXXXXXXXX',
'Accept: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
With this API you can delete pastes created by the API user. You will need to send a valid POST request to the URL below to access the data:
Include all the following POST parameters when you request the URL:
- id - this is the unique id of the paste you want to delete.
Below is a curl command example how to delete a paste:
curl --location 'http://ptest.dk/api/paste/delete' \
--header 'Authorization: Bearer ' \
--header 'Accept: application/json' \
--form 'id="1"'
Possible Good API Responses:
{
"success": "Paste successfully deleted"
}
Possible Bad API Responses:
{
"message": "Unauthenticated."
}
{
"error": "Paste not found"
}
Other API Endpoints
Following API endpoints are used for various other functions.
- https://gistpad.com/api/paste/update
- https://gistpad.com/api/search
- https://gistpad.com/api/trending
- https://gistpad.com/api/raw/paste-slug
- https://gistpad.com/api/pages/page-slug
- https://gistpad.com/api/u/username
- https://gistpad.com/api/report-issue
- https://gistpad.com/api/profile
Not a member of Fast Pastebin Alternative yet?
It unlocks many cool features!
We use cookies for various purposes including analytics. By continuing to use Fast Pastebin Alternative, you agree to our use of cookies as described in the Privacy Policy.