Developers API

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 GistPad Login Or Sign Up to get your API Key.
Creating A New gist
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 gist.

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 is used to set expire time of paste, following are the values, Never - N, 10 Minutes- 10M, 1 Hour - 1H, 1 Day - 1D, 1 Week - 1W, 2 Week - 2W, 1 Month - 1M, 6 Month - 6M, 1 Year - 1Y, Burn After Read - B
6. password - this is optional parameter which makes paste password protected, value can have max length upto 50 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, below you can find a list of all the possible values you can use in combination with syntax_id. Always include the value on the left from the list below, the value on the right is just the full name of the language in question.
https://gistpad.com/api/archive
    2 = ActionScript
    3 = Ada
    4 = Apache Log
    5 = AppleScript
    6 = ASM (NASM)
    7 = ASP
    8 = Bash
    9 = C
    10 = C for Macs
    11 = CAD DCL
    12 = CAD Lisp
    13 = C++
    14 = C#
    15 = ColdFusion
    16 = CSS
    17 = D
    18 = Delphi
    19 = Diff
    20 = Batch
    21 = Eiffel
    22 = Fortran
    23 = FreeBasic
    24 = Game Maker
    25 = HTML
    26 = INI file
    27 = Java
    28 = JavaScript
    29 = Lisp
    30 = Lua
    32 = MPASM
    33 = MySQL
    34 = NullSoft Installer
    35 = Objective C
    36 = OCaml
    37 = Openoffice BASIC
    38 = Oracle 8
    39 = Pascal
    40 = Perl
    41 = PHP
    42 = Python
    43 = QBasic
    44 = Robots
    45 = Ruby
    46 = Scheme
    47 = Smarty
    48 = SQL
    50 = VisualBasic
    51 = VB.NET
    52 = VisualFoxPro
    53 = XML
    54 = AutoIt
    55 = Blitz Basic
    56 = BNF
    57 = Erlang
    58 = Genero
    59 = Groovy
    60 = Haskell
    61 = Inno Script
    62 = Latex
    63 = Linden Scripting
    64 = MatLab
    65 = M68000 Assembler
    66 = mIRC
    67 = Rails
    68 = PL/SQL
    69 = Smalltalk
    70 = TCL
    72 = Z80 Assembler
    73 = ABAP
    74 = ActionScript 3
    75 = APT Sources
    76 = Avisynth
    77 = Basic4GL
    78 = BibTeX
    79 = BrainFuck
    80 = BOO
    81 = CFDG
    82 = C Intermediate Language
    83 = CMake
    84 = COBOL
    85 = DCS
    86 = DIV
    87 = DOT
    88 = Email
    89 = FO Language
    90 = GetText
    91 = OpenGL Shading
    92 = Ruby Gnuplot
    93 = HQ9 Plus
    94 = IDL
    95 = INTERCAL
    96 = IO
    97 = Java 5
    98 = KiXtart
    99 = Clone C
    100 = Clone C++
    101 = Loco Basic
    102 = LOL Code
    103 = Lotus Formulas
    104 = Lotus Script
    105 = LScript
    106 = Make
    107 = Modula 3
    108 = MXML
    109 = Oberon 2
    110 = OCaml Brief
    111 = Oracle 11
    112 = Per
    113 = PHP Brief
    114 = Pic 16
    115 = Pixel Bender
    116 = POV-Ray
    117 = PowerShell
    118 = Progress
    119 = Prolog
    120 = Properties
    121 = ProvideX
    122 = REBOL
    123 = REG
    124 = SAS
    125 = Scala
    126 = Scilab
    127 = SdlBasic
    128 = Tera Term
    129 = thinBasic
    130 = T-SQL
    131 = TypoScript
    132 = VeriLog
    133 = VHDL
    134 = VIM
    135 = Visual Pro Log
    136 = WhiteSpace
    137 = WHOIS
    138 = Winbatch
    139 = Xorg Config
    140 = XPP
    141 = Pawn
    142 = 4CS
    143 = 6502 ACME Cross Assembler
    144 = 6502 Kick Assembler
    145 = 6502 TASM/64TASS
    146 = Motorola 68000 HiSoft Dev
    147 = ALGOL 68
    148 = autoconf
    149 = Autohotkey
    150 = Awk
    151 = Cuesheet
    152 = ChaiScript
    153 = Clojure
    154 = C++ (with Qt extensions)
    155 = E
    156 = ECMAScript
    157 = Formula One
    158 = F#
    159 = GAMBAS
    160 = GDB
    161 = Genie
    162 = Go
    163 = GwBasic
    164 = HicEst
    165 = Icon
    166 = J
    167 = jQuery
    168 = Liberty BASIC
    169 = Logtalk
    170 = MagikSF
    171 = MapBasic
    172 = MIX Assembler
    173 = Modula 2
    174 = newLISP
    175 = Objeck Programming Language
    176 = Oz
    177 = Delphi Prism (Oxygene)
    178 = Oz
    179 = PCRE
    180 = Perl 6
    181 = OpenBSD PACKET FILTER
    182 = Pike
    183 = PostgreSQL
    184 = PowerBuilder
    185 = PureBasic
    186 = q/kdb+
    187 = RPM Spec
    188 = R
    189 = SystemVerilog
    190 = Vala
    191 = Unicon
    192 = Vala
    193 = XBasic
    194 = ZXBasic
    195 = UnrealScript
    196 = HTML 5
    197 = ProFTPd
    198 = BASCOM AVR
    199 = C: Loadrunner
    200 = CoffeeScript
    201 = EPC
    202 = Falcon
    203 = LLVM
    204 = PyCon
    205 = YAML
    206 = FreeSWITCH
    217 = ARM
    218 = Asymptote
    219 = DCL
    220 = DCPU-16
    221 = Haxe
    222 = LDIF
    223 = Nagios
    224 = Octave
    225 = ParaSail
    226 = PARI/GP
    227 = Python for S60
    228 = Rexx
    229 = SPARK
    230 = SPARQL
    231 = StoneScript
    232 = UPC
    233 = Urbi
    234 = Vedit
    235 = Markdown (PRO members only)
    236 = AIMMS
    237 = Chapel
    238 = Dart
    239 = Easytrieve
    240 = ISPF Panel Definition
    241 = JCL
    242 = Nginx
    243 = Nim
    244 = PostScript
    245 = QML
    246 = Racket
    247 = RBScript
    248 = Rust
    249 = SCL
    250 = StandardML
    251 = VBScript
    252 = C (WinAPI)
    253 = C++ (WinAPI)
    254 = NetRexx
    255 = JSON
    256 = Swift
    257 = SuperCollider
    258 = Julia
    259 = Blitz3D
    260 = BlitzMax
    261 = SQF
    262 = Puppet
    263 = Filemaker
    264 = Euphoria
    265 = PL/I
    266 = Open Object Rexx
    267 = Markdown
    268 = Kotlin
    269 = Ceylon
    270 = Arduino
    271 = YARA
    272 = TypeScript
    276 = Mercury
    277 = MetaPost
    278 = MK-61/52
    279 = Phix
    280 = Roff Manpage
    282 = SSH Config
    283 = TeXgraph
    285 = Xojo
    286 = KSP (Kontakt Script)
    287 = GDScript
    288 = Godot GLSL
    1 = None
 
Creating A New Paste, The category_id Parameter In Detail
https://gistpad.com/api/categories
We have many categories available, below you can find a list of all the possible values you can use in combination with category_id. Always include the value on the left from the list below, the value on the right is just the full name of the language in question.
    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 (only allowed in combination with X-API-KEY (headers), as you have to be logged into your account to access the paste)
Creating A New Paste, The folder_id Parameter In Detail
You can retrive your folder's id with following API endpoint.
https://gistpad.com/api/my-folders
Listing Pastes Created By A User
You can retrive your pastes with following API endpoint.
https://gistpad.com/api/my-pastes
Deleting A Paste Created By A User
You can delete your paste with 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 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:
1. 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