API Documentation

Chesspastebin feature an API so that other software out there could add, view and remove games from the database. The get an API account please send an email to toomasr@gmail.com and you will receive an API key.

Adding games

URL: http://www.chesspastebin.com/api/add/
Method: POST
Returns: Prints out the ID (integer). You can view the game at http://www.chesspastebin.com/?p=ID

Key Value Comment
apikey Your API key Required
pgn The PGN of the game Required
name Name of the uploader Optional. Defaults to Noname
email Email of the uploader Optional. Defaults to no_body@no_where.org
sandbox true | false Optional. Defaults to false. In case of true will not add the post but will do the regular validation of the request. On success will print out 42 as the ID.

Removing games

Not implemented at the moment.

  • Pingback: Updated design & API documentation | Chess Pastebin()

  • Le Do Hoang Long

    Great idea!

    How to get an api key? I want to make a little web application for this!

  • http://www.zeroturnaround.com/ Toomas Römer

    Sent you one in private. As there are not very many request then I do it manually.

  • chess player

    I like this program !
    I have http://locchess.wordpress.com and i want to install it. 
    Can you help me ?

  • http://www.zeroturnaround.com/ Toomas Römer

    There is a WordPress plugin that uses this library as the backend. See http://wordpress.org/extend/plugins/chess-game-viewer-control-panel/

    Hope this helps,

  • Minh-Tue Vo

    Hi ! Can you export the board as gif or png?

  • http://www.zeroturnaround.com/ Toomas Ru00f6mer

    Not at the moment but I kind of like the idea. What exactly do you have in mind? You play couple of moves and click on download as gif? Why not take a screenshot?

  • Alkis Chrysostomidis

    What has happened to the site? I’ve been trying to put a game of mine and it’s not possible. Till yesterday everything was ok!

  • http://www.zeroturnaround.com/ Toomas Römer

    Works for me. Are you still having problems?

  • http://deuts.net/ deuts

    Hi Toomas, so you’re saying you’re just using the Chess Game Viewer WordPress plugin for this website?

  • http://www.zeroturnaround.com/ Toomas Römer

    I actually use the one that comes bundled with the library. The releases are at https://github.com/toomasr/jspgnviewer/releases

    I’m not sure why I didn’t make a WordPress plugin you can install from inside wordpress. I think there were already some using my JS plugin that I didn’t want to roll my own. I can definitely reconsider that.

  • http://deuts.net/ deuts

    On second thought, I actually would want to implement this same functionality to my own website, perhaps in a separate clean install, although I can only post — not the public. I wonder if I can do the same with just the plugins?

  • http://www.zeroturnaround.com/ Toomas Römer

    Yup. You can do the same without any wordpress plugins. Using just the JavaScript library is enough.

  • MarcosWade

    I want an API key.