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 format.

Request

Send your request to Endpoint:
https://pastr.io/api/post/ID?api_token=KEY

Make sure to send with Content-Type: application/json.

Responses JSON

Success:
{
    "data": {
        "unique_id": "ECa3goGqV94",
        "title": "title",
        "text": "text",
        "syntax": "nohighlight",
        "created_at": "2020-07-09 21:09:59"
    }
}
API key is wrong:
{
    "error": {
        "message": "Unauthorized"
    }
}
ID not found:
{
    "error": {
        "message": "Not found"
    }
}
Limit exceeded:
{
    "error": {
        "message": "Limit exceeded"
    }
}

Syntax

Every response will contain a syntax, heres a list to see what the syntax response could be.

"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 GET posts from our website in a JSON response. You are NOT allowed to share your API key. If you share your API key you will be permenantly banned.