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.

  1. Your Unique Developer API Key
  2. Creating A New Paste
  3. Creating A New Paste, [Required Parameters]
  4. Creating A New Paste, [Optional Parameters]
  5. Creating A New Paste, The 'syntax_id' Parameter In Detail
  6. Creating A New Paste, The 'category_id' Parameter In Detail
  7. Creating A New Paste, The 'expire' Parameter In Detail
  8. Creating A New Paste, The 'status' Parameter In Detail
  9. Creating A New Paste, The 'folder_id' Parameter In Detail
  10. Listing Pastes Created By A User
  11. Deleting A Paste Created By A User
  12. 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:

  1. X-API-KEY (headers) - which is your unique API Developers Key.
  2. 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:

  1. title - this will be the name / title of your paste.
  2. status - this is required parameter which makes paste public, unlisted or private, public = 0, unlisted = 1, private = 2
  3. syntax_id - this is optional parameter, value must be valid syntax id from given Archive List API
  4. category_id - this is optional parameter, value must be valid category id from given Category List API
  5. expire - this is optional parameter which makes it used to set expire time of paste.
  6. password - this is optional parameter which makes paste password protected.
  7. 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:

  1. 5 = Cryptocurrency
  2. 4 = Cybersecurity
  3. 7 = Fixit
  4. 8 = Food
  5. 9 = Gaming
  6. 10 = Haiku
  7. 11 = Help
  8. 12 = History
  9. 13 = Housing
  10. 14 = Jokes
  11. 15 = Legal
  12. 16 = Money
  13. 6 = Movies
  14. 17 = Music
  15. 18 = Pets
  16. 19 = Photo
  17. 20 = Science
  18. 21 = Software
  19. 27 = Source Code
  20. 22 = Spirit
  21. 23 = Sports
  22. 24 = Travel
  23. 25 = TV
  24. 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.

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.