Free Paste API

rPaste has an easy-to-use REST API that allows you to create new pastes, view details of existing pastes, delete pastes that you created, and obtain information about the various syntax highlighting options available.

The API is limited to 20 new pastes per hour. You can fetch details of as many pastes as you want.

Examples

View details about a paste

Make a GET request to the following URL

URL : https://rpaste.com/api/paste/detail

Available Parameters :

slug : Slug of the paste snippet
password (optional) : Password for the paste snippet

http https://rpaste.com/api/paste/detail slug==pdLHrAv

returns

{
"body": "def greet():\r\n print(\"Hello world this is rpaste sample\")",
"created_at": "2017-11-08T17:50:28.153Z",
"exposure": "Public",
"language": "python-3",
"slug": "pdLHrAv",
"title": "rPaste python sample"
}

View available syntax highlightings

URL : http https://rpaste.com/api/languages/list

This will show the available languages for syntax highlighting.

Create a new paste

Make a POST request to the following URL

URL : https://rpaste.com/api/paste/add

Available Parameters :

pastebody (required): Content of the snippet
language (optional): Language for syntax highlighting.
exposure (optional): Exposure of the paste
pastetitle (optional): Title for the paste
password (optional): Password for the paste (You will need this password to unlock the paste later)
temporary (optional): Temporary pastes will be deleted after 24 hours. value is "yes" or "no"

http -f POST https://rpaste.com/api/paste/add pastebody="Hello world" language="none" exposure="public"

returns

{
"slug": "pM2Byzi",
"status": "success",
"uid": "9c03c8e5-7499-4f8d-a9a2-612760d7156d",
"url": "http://rpaste.com/pM2Byzi"
}

The uid can be used to delete the paste later.

Delete existing paste

Paste snippets can be deleted within 1 minute after they are created. If you know the UID of the paste (returned by the new paste API), you can delete a paste anytime. To delete a paste, make a DELETE request to the URL below

URL : https://rpaste.com/api/paste/delete

Available Parameters :

slug (required): Slug of the paste snippet
uid (optional): UID of the paste snippet

http DELETE https://rpaste.com/api/paste/delete slug==pdLHrAv uid=="51b69110-c8f2-47a3-aa6b-3dc00e655110"

returns

{
"status": "success",
}