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!

  • 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 ?

  • 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,
    Toomas

  • Minh-Tue Vo

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

  • 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!

  • Works for me. Are you still having problems?

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

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

  • 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?

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

  • MarcosWade

    I want an API key.

  • Hi Marcos,

    if you are still interested drop me a line at toomasr [at] gmail. I very often miss the comment notifications but most people ask for API keys via email so I presumed the process has been working as emails still are coming in 🙂

    If you have any needs for GET stuff let me know and I can work something out.

    Cheers,
    T