API Documentation

Getting started

To get started you'll need to register an API key in your settings under Developer. If you're not a member, you can register here.

Congratulations, you can now start sending requests to our webpage in a GET and POST format.

Requests

Content-Type: application/json

GET

https://pastr.io/api/post/get
Example response
{
    "status": "ok",
    "data": {
        "id": "ECa3goGqV94",
        "title": "title",
        "text": "text",
        "syntax": "nohighlight",
        "created_at": "2020-07-09 21:09:59"
    }
}

POST

https://pastr.io/api/post/create
Example response
{
    "status": "ok",
    "data": {
        "id": "ECa3goGqV94",
        "created_at": "2020-07-09 21:09:59"
    }
}

Parameters

Parameter Request Description
api_token GET/POST API token is required for either GET and POST requests.
id GET ID is required for the request to receive the information about the post. ID, for example looks like this: ECa3goGqV94
title POST Title is optional (default => Untitled) for creating a new post. It has a max character size of 25 characters and if not set, will be posted as Untitled.
syntax POST Syntax is required for creating a new post. It sets the syntax highlighting of the post. If not set to either one of those seen below, it will be automatically set to nohighlight.
expiration POST Expiration is optional (default => never) for creating a new post. It sets the expiration time of the post. If not set to either one of those seen below, it will be automatically set to never. If you want to create a post which doesnt have a expiration date, you do not need to use this parameter.
text POST Text is required for creating a new post. No text makes no sense, right?
visibility POST Visibility is required for creating a new post. Visibility is an integer and sets the visibility of the post. 0 = public, 1 = private

Expiration

"10minutes",
"20minutes",
"30minutes",
"1hour",
"2hour",
"4hour",
"12hour",
"24hour"

Syntax

"nohighlight",
"1c",
"abnf",
"accesslog",
"ada",
"armasm",
"avrasm",
"actionscript",
"apache",
"applescript",
"asciidoc",
"aspectj",
"autohotkey",
"autoit",
"awk",
"axapta",
"bash",
"basic",
"bnf",
"csharp",
"cpp",
"cos",
"cmake",
"coq",
"csp",
"css",
"capnproto",
"clojure",
"coffeescript",
"crmsh",
"crystal",
"d",
"dns",
"dos",
"dart",
"delphi",
"diff",
"django",
"dockerfile",
"dsconfig",
"dts",
"dust",
"ebnf",
"elixir",
"elm",
"erlang",
"excel",
"fsharp",
"fix",
"fortran",
"gcode",
"gams",
"gauss",
"gherkin",
"go",
"golo",
"gradle",
"groovy",
"html",
"http",
"haml",
"handlebars",
"haskell",
"hy",
"ini",
"inform7",
"irpf90",
"json",
"java",
"javascript",
"leaf",
"lasso",
"less",
"ldif",
"lisp",
"livecodeserver",
"livescript",
"lua",
"makefile",
"markdown",
"mathematica",
"matlab",
"maxima",
"mel",
"mercury",
"mizar",
"mojolicious",
"monkey",
"moonscript",
"n1ql",
"nsis",
"nginx",
"nimrod",
"nix",
"ocaml",
"objectivec",
"glsl",
"openscad",
"ruleslanguage",
"oxygene",
"pf",
"php",
"parser3",
"perl",
"pony",
"powershell",
"processing",
"prolog",
"protobuf",
"puppet",
"python",
"profile",
"k",
"qml",
"r",
"rib",
"rsl",
"graph",
"ruby",
"rust",
"SQL",
"p21",
"scala",
"scheme",
"scilab",
"shell",
"smali",
"smalltalk",
"stan",
"stata",
"stylus",
"subunt",
"swift",
"tap",
"tcl",
"tex",
"thrift",
"tp",
"twig",
"typescript",
"vbnet",
"vbscript",
"vhdl",
"vala",
"verilog",
"vim",
"x86asm",
"xl",
"xpath",
"zephir"

Limits

Every API key has a limit of 1000 requests per hour. If you need more, contact us.

Disclaimer

With our API you are able to make GET and POST requests to our website. You are NOT allowed to share your API key. If you share your API key you will be permanently banned.