• about 'nu'Learn more about VGA Planets "Nu"
  • the projectAbout the VGA Planets "Nu" project, the official web based remake of VGA Planets.
  • contactContact the VGA Planets "Nu" team.
VGA Planets
YEAR: 001414th year of the first Emperor war
  • HomeVGA Planets is a space strategy game that became the largest play by email game ever created. VGA Planets Nu is the new 2010 web edition of this classic turn-based game, originally launched in 1992.
  • My Games
  • Join GameThe Echo Cluster
  • News and EventsBlog posts, recent posts and player events.
  • LeaderboardView the top players in the VGA Planets Nu community.
  • ForumsVGA Planets discussion forums.
  • FeedbackSend us suggestions and report bugs here on our UserVoice.
  • How to PlayVGA Planets "Nu" documentation.
  • UpgradeSign up for VGA Planets Nu and start playing the greatest space strategy game ever created.
  • Sign In
Edit - Delete
Show Media ItemShow Media Item - Attention all Hackers! The first Planets Nu API has arrived.

Attention all Hackers! The first Planets Nu API has arrived.

Wednesday, December 21, 2011
There has been a significant amount of interest in being able to build additional tools and utilities for working with planets data and even some thoughts about building completely new clients for other platforms. To help empower our very creative community we have created a new application programming interface (API). 

The purpose of an API is to make it easy for software developers to download and manipulate Planets data in their preferred programming language. This allows them to build tools that can display this data in interesting ways or on different platforms, find patterns or optimize the data, or to build interesting ways to play your turns or parts of your turns. 

Examples of things interested programmers could build would be: 
  • More graphs and display charts for scores and game info
  • Ability to view or play your turns in a clean and simple way on your phones
  • Create a very strong computer player
  • Create a tool to "double check" your turn for various things
  • ... and many more.
We look forward to seeing what can be created with this data!  

For Developers


This is the first Alpha version of the API and could be subject to change. We have implemented 4 API's thus far which allow you read only access to the game data. We will be adding several more API's including a Save API which will allow turn updates.  

The following API commands are now possible or proposed:
  • Login - Use this to acquire the apikey of a given player. 
  • List Games - List the games on the Planets Nu platform in various ways
  • Load Game Info - Load the publicly available data about a single game
  • Load Turn Data - Load a single players complete turn package
  • Save Turn Data [NOT YET IMPLEMENTED]
  • Create Game [NOT YET IMPLEMENTED]
  • Run Host [NOT YET IMPLEMENTED]
The API documentation table of contents can be found here: http://planets.nu/api-documentation

There is still a lot more documentation needed, but there should be enough to get you started. We want to make this API a success. So if you start on a project and find you need some additional information or a new specific API please write us using the Contact Us link. We will do our best to get you what you need or help you achieve your goals. 

A word of advice to all developers: "Start small, think big", there is a lot of fun to be had in building Planets related tools and in some ways it can be very easy, but the sheer volume of data that makes up a Planets universe is easy to underestimate. It might seem like a super idea to build a complete client for iPhone, and it is, but unless you have a year of your life to spare, start by building a message viewer, or VCR player or score display tool before jumping into the complete massive project. 

Have fun and let us know what you are building! 

Edit - Delete
CommentsComments - Comments

Comments

 
There are 23 comments - add your comment
figak - Wednesday, December 21, 2011 12:28 PM
Nice one ;)
emork the lizard king - Wednesday, December 21, 2011 2:23 PM
Great!


http://api.planets.nu/games/list?username=joshua

seems to return all games. Same with other usernames.

joshua - Wednesday, December 21, 2011 6:10 PM
Good find Emork, this is now fixed. The API is definitely still in an Alpha stage but should mature quickly if we get some takers.
handsomecam - Thursday, December 22, 2011 3:32 AM
Is the login method only available over http (as opposed to https) currently?
joshua - Thursday, December 22, 2011 6:16 AM
Yes.
oliphaunt - Thursday, December 22, 2011 11:41 AM
Veeery nice! I'm definitely planning to do some hacking. I have something nice (and not too large) in mind already.

Should we have a separate forum section for discussing and publishing user-developed tools using the API? Those don't really fit elsewhere.
oliphaunt - Thursday, December 22, 2011 12:46 PM
Follow-up to handsomecam: his question was presumably because the "Login API" docs specify an https URL.

Also, I inadvertently discovered the password of the 'test' account... ;-)
oliphaunt - Friday, December 23, 2011 12:07 AM
I whipped up a greasemonkey script that automatically loads planet data from a selected game into the vga planets calculator at http://www.vgaplanets.ca/vgapcalc.php#taxhappy .

My script is available here:
http://userscripts.org/scripts/show/121155

Like the API itself it's still alpha; I only tested it in Firefox, and the API key and game ID have to be entered in the source. That will change.

I love the API so far!

One thing: I accidentally (and very briefly) published my API key on userscripts.org. I changed my password, but the old API key is apparently still valid.
oliphaunt - Friday, December 23, 2011 9:27 AM
Version 0.2 is now available :-) More info, and follow further progress here: http://planets.nu/discussion/announcement-script-using-api-for-automatically-loa ding-planet-data-into-the-vgap-calculator

The issue remains that apparently, the API key stays the same even if password is changed.
mjs68508 - Friday, December 23, 2011 6:06 PM
I like the idea of a separate section in the forums for this.
skiv - Saturday, December 24, 2011 5:23 PM
May be xml will be also useful? For example (converted from json): http://planets.nu/_library/2011/12/planets.xml
oliphaunt - Wednesday, December 28, 2011 10:23 AM
Suggestion for the "List Games" API: change 'type' and 'status' from simple values to binary flags.

So e.g. for status: 1 - Joining, 2 - Running, 4 - Finished, 8 - Hold, so values can be added together to allow for combinations.

For example I could then pass 15 if I want to list all games regardless of status or 11 if I want to list everything except finished games.
kwesy - Thursday, January 05, 2012 12:34 PM
The loadgameinfo call is broken ATM.
joshua - Thursday, January 05, 2012 2:40 PM
Kwesy, can you message me what you are seeing. I'm not seeing anything broken.
kwesy - Thursday, January 05, 2012 3:24 PM
@Joshua:
in the description at the top of this page click on 'Load game info' and then on the one example link.
I'm getting the error with different browsers.
The other api calls work.

I posted the issue in a separate topic in the forum (including the error message)
joshua - Thursday, January 05, 2012 3:38 PM
Fixed, thanks for pointing that out.
ronnle robot - Saturday, January 21, 2012 6:26 PM
The Turn Data that you can retrieve via the API contains VCR information. Does anyone know if there is any stand-alone or online VCR player that would be able to feed off this data and replay the VCRs? There has been a number of people requesting the ability to share VCRs among allies.
joshua - Sunday, January 22, 2012 1:20 PM
Ronnle, that feature is right up there on our to-do list actually. We can get the VCR's to the allies quite easily and are planning to add that right into the normal game interface.
streu - Sunday, January 22, 2012 1:44 PM
@ronnle robot: This Perl program can download Nu data and create "vcr.dat" files to load into PlayVCR.
streu - Sunday, January 22, 2012 2:11 PM
Great, it ate my link. Maybe this one works: http://phost.de/~stefan/bits.html#c2nuvcr


--Stefan
ronnle robot - Sunday, January 22, 2012 4:33 PM
Thanks Joshua, looking forward to that feature :-)

Thanks Stefan, will see what I can make of this script in the mean time :-)
dines - Tuesday, January 24, 2012 9:20 PM
maybe you should continue your debate in the forum ?
The comments in here, are only visible if you find the specific news post.
ronnle robot - Wednesday, February 22, 2012 12:13 AM
Is the API access currently working? I'm getting:

Error: An API error has occurred - Method not found: 'System.String GeoTools.DataAccess.BaseObject.ToJson(Boolean)'. at PlanetsAPI.API.LoadTurn(HttpRequest request)\r\n at PlanetsAPI.API.ProcessRequest(HttpContext context)

Your Comment

Your Name

To receive emails create a username or Sign In
Your Email
Username
Password
Confirm Password
Add me to the contact list.
Remember me on this computer.
Sign in below or Sign Up
Username
Password
loading...  Post Comment
 

Follow VGA Planets on Twitter Play Planets on Facebook!
© Copyright 2010 Geographical Media Inc.
 About Planets Nu - Contact Us - Site Rules - API