Recommend
171 
 Thumb up
 Hide
1302 Posts
1 , 2 , 3 , 4 , 5  Next »  [53] | 

BoardGameGeek» Forums » BoardGameGeek Related » BGG General

Subject: BoardGameGeek XML API rss

Your Tags: Add tags
Popular Tags: xmlapi [+] api [+] xml [+] favthreads [+] [View All]
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
Wouldn't it be nice if you could access geek data in a programmatic way? It would be handy if your game tracking tool could look up game IDs based on name, or get a machine readable version of some game statistics without having to do all that screen scraping, right?

Well, now you can. It's starting off with a limited set of features, but I wanted to get feedback and requests before I spend time building parts that are going to be less used. So, to start off here's what you can get via the new XML API:

- Search for games by name
- Get basic information on a game
- Get statistics on a game (rank, etc)
- Get comments on a game (listed by username)

There are currently two XML API URLs of relevance:

http://boardgamegeek.com/xmlapi/search
http://boardgamegeek.com/xmlapi/game/[gameid]

Both take some parameters as URL encoded components of the query string.

/xmlapi/search takes a single required parameter "search" which is what to search for and an optional parameter "exact", which should be set to 1 to get exact search. Search is always case insensitive.

For example:

http://www.boardgamegeek.com/xmlapi/search?search=euphrat
http://www.boardgamegeek.com/xmlapi/search?search=ra&exact=1

/xmlapi/game/[gameid] has no required parameters other than the gameid which is part of the URL. It has two optional parameters, "stats" which adds a statistics element to the game xml, and "comments" which adds a comments element listing all comments on the game. For example:

http://boardgamegeek.com/xmlapi/game/3727
http://boardgamegeek.com/xmlapi/game/3727?comments=1
http://boardgamegeek.com/xmlapi/game/3727?stats=1
http://boardgamegeek.com/xmlapi/game/3727?comments=1&stats=1

So, what additional information should be exposed. I'm interested in suggestions and feedback, but I will add a few qualifiers:

- I'm more interested in suggestions involving game data than forums/geeklists.
- I'm more interested in specific real use cases than theoretical "it would be neat if..." cases. That is, someone who says: "I have a free game play tracking tool and I will use the /xmlapi/search interface to sync with bggids, but I could really use..." is more likely to get done than someone who says "It'd be neat to have a list of image URLs for a game".
- Don't abuse the system. This isn't license to slam the servers. Self regulate your hit rate. There are no limits in place now, but they'll get added if it becomes a problem.
- Stuff that will be low impact on the servers and likely to be useful even when only hit occasionally will be more likely to be implemented than stuff that it likely to get reloaded constantly by programs.
- Because of various database constraints, some things are simply easier than others. Because of time constraints, these will get implemented first. Don't take it personally if the thing you want doesn't get implemented.

So, what would be useful to add?

What are you going to do with the initial stuff I've given you?
12 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Simon Hunt
United States
Roseville
California
flag msg tools
designer
mb
Oops!

XML Parsing Error: not well-formed
Location: http://www.boardgamegeek.com/xmlapi/game/12962
Line Number 8, Column 39:
<publisher publisherid="83"><name>R&D Games</name>
---------------------------------------------^


Looks like you have to escape the data...

~Simon
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
simonh wrote:

Looks like you have to escape the data...


Fixed.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Simon Hunt
United States
Roseville
California
flag msg tools
designer
mb
Hi Matthew,

Request 1
I would like to see the addition of a reference to the (thumbnail) image with most recommendations for the game. For example,
<game gameid="20847">
...
<name primary="true">Take Stock</name>
<thumbnail>
http://files.boardgamegeek.com/bggimages/pic102092_t.jpg
</thumbnail>

...
</game>


Request 2
I also want to be able to generate a list of the games in my collection. (Filters would be a nice addition, but not immediately necessary).


Planned Project
I plan to use this to be able to create a "My Game Collection" database on my Palm PDA. My Palm App will allow me to filter by number of players, etc. to generate some recommendations for games to play.

 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Simon Hunt
United States
Roseville
California
flag msg tools
designer
mb
On-line Games status
I would like to be able to get an XML feed for the current status of my online games. For example:

http: //boardgamegeek.com/xmlapi/onlineGameStatus?userid=simonh

(the userid parameter could be dropped if you used my login cookie, I guess)

I would like the data to contain the name of the game, the players, whose turn it is (a flag if it is my turn?) and a link that would take me to the game, etc.

I would create (and publish) a Google Desktop 2.0 Sidebar Plug-In that polled the server once every 5 minutes to display the current state of my games. (Is this an "excessive hit rate" ?).

~Simon
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Go Take A Hike
United States
Columbus
Ohio
flag msg tools
Where's the beef?!
badge
I don't think anybody's back there.
mbmbmbmbmb
Quote:
Wouldn't it be nice if you could access geek data in a programmatic way?


Excellent! I'll definitely take a look when I get home.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Go Take A Hike
United States
Columbus
Ohio
flag msg tools
Where's the beef?!
badge
I don't think anybody's back there.
mbmbmbmbmb
Quote:
Looks like you have to escape the data...


For clarification I'm assuming that you're referring to CDATA tags?

 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
simonh wrote:

Request 1
I would like to see the addition of a reference to the (thumbnail) image with most recommendations for the game. For example,

...
Take Stock

http://files.boardgamegeek.com/bggimages/pic102092_t.jpg

...



I'll add something like this soon.

Quote:

Request 2
I also want to be able to generate a list of the games in my collection. (Filters would be a nice addition, but not immediately necessary).


I'll add filtering eventually, but here you go:

http://boardgamegeek.com/xmlapi/collection/simonh

Currently, it only reports gameids, ratings and comments for owned games. I'll add more filtering options later.

Quote:

Planned Project
I plan to use this to be able to create a "My Game Collection" database on my Palm PDA. My Palm App will allow me to filter by number of players, etc. to generate some recommendations for games to play.


Cool.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Simon Hunt
United States
Roseville
California
flag msg tools
designer
mb
mkgray wrote:


simonh wrote:

Request 2
I also want to be able to generate a list of the games in my collection. (Filters would be a nice addition, but not immediately necessary).


I'll add filtering eventually, but here you go:

http://boardgamegeek.com/xmlapi/collection/simonh

Currently, it only reports gameids, ratings and comments for owned games. I'll add more filtering options later.


Wow, that was fast! Perfect!!
Thanks Matthew.

~Simon
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Yehuda Berlinger
Israel
Jerusalem
flag msg tools
designer
mbmbmbmbmb
I just want to say that however people use this, this feature is so critically important it is hard to overstate how important it is. Thank you, thank you.

And "however people use this" is exactly the point; you will see some amazing things come out of this.

Yehuda
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Mikko Saari
Finland
flag msg tools
http://www.lautapeliopas.fi/ - the best Finnish board game resource!
badge
mbmbmbmbmb
I wasn't even going to request it, but thanks for adding the collection tool. I'll be using that to sync my personal game database ratings with my Geek ratings. Very cool. Thanks!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
simonh wrote:

Wow, that was fast! Perfect!!


Some things are hard, some things are easy, and some things are essentially trivial. Trivial stuff gets done fast. There are just so many things I could theoretically do, even in the trivial category and that's why I'm soliciting the requests here :-)

As for the online games stuff, I haven't poked around that part of the db, so it's less likely in the immediate future.

I added two parameters on /xmlapi/collection/username

all=1 gives everything that the user has rated, has commented on, owns, wants, wishes for, etc. Without this, it is only games owned.

withcomments=1 filters to only games with comments.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Simon Hunt
United States
Roseville
California
flag msg tools
designer
mb
I'd also like a query that returns my wishlist, complete with my selected priority for each game. I expect others would want to be able to retrieve their want lists and for trade lists.

(I looked at the collection/user/all=1 output but cannot pull out the wishlist only stuff from that output.)
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
simonh wrote:
I'd also like a query that returns my wishlist, complete with my selected priority for each game. I expect others would want to be able to retrieve their want lists and for trade lists.

(I looked at the collection/user/all=1 output but cannot pull out the wishlist only stuff from that output.)


/xmlapi/collection/username now supports the following parameters:

(Default is to list only games owned by username)

all: include all games rated, commented, owned, for trade, etc.
notown: Only include games not owned
withcomments: Only include games with comments
want: Only include games on the want list
fortrade: Only include games listed for trade
forsale: Only include games listed for sale
onwishlist: Only include games on wishlist

Various attributes have been added to the games, which are included regardless of the above filtering. For example:

http://boardgamegeek.com/xmlapi/collection/mkgray?withcommen...

shows the 12 games I have on my wishlist, don't own and have made comments on.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Tom "Snicker Daddy" Pancoast
United States
Henrico
Virginia
flag msg tools
mbmbmbmbmb
Cool!

Would access to a user's games played data be one of those trivial tasks?

I e-mailed Aldie once about doing an offline collection and games played manager. He was receptive to the idea, but time seemed to get in the way. Are there any plans to be able to post collection or games played information back to the Geek?

I wanted to write a program that would let you keep more information about your collection than what is available on BGG.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Go Take A Hike
United States
Columbus
Ohio
flag msg tools
Where's the beef?!
badge
I don't think anybody's back there.
mbmbmbmbmb
Can the collection api return the gamename (in addition to the gameid)? Stats for each game would be cool as well.

 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
tpancoast wrote:

Would access to a user's games played data be one of those trivial tasks?


Nope, but it might fall in the easy category. I'll try to look at it.

Quote:

Are there any plans to be able to post collection or games played information back to the Geek?


You can already post games played information just by looking at the existing form fields.

For example:

http://www.boardgamegeek.com/lastplayed.php3?gameid=[ID]&playdate=[YEAR]-[MON]-[DAY]&quantity=[Q]&B1=Submit

works, as long as you send "bggusername" and "bggpassword" cookies along with your request. I use this all the time to keep my game plays in sync.

Collection data is presumably similarly manageable, I just haven't done it myself.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
matthew.marquand wrote:
Can the collection api return the gamename (in addition to the gameid)?


Added.

Quote:

Stats for each game would be cool as well.


I'm not going to add this for now. If you want the stats on a game, you can easily request the /xmlapi/game/[gameid]?stats=1 page and get them. It doesn't seem right including it in the collection output.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Pearsall
United States
Castleton
New York
flag msg tools
Check out my blog, Board Game Radar!!!
badge
Stop! That tickles!
mbmbmbmbmb
simonh wrote:



Planned Project
I plan to use this to be able to create a "My Game Collection" database on my Palm PDA. My Palm App will allow me to filter by number of players, etc. to generate some recommendations for games to play.


This would be awesome. Would you make it available for us non-programming types? I would love a database of my games on my Treo showing number of players, BGG rank, BGG weight, playing time, etc...
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Melissa
Australia
Parkville
Vic
flag msg tools
admin
designer
May you find the Perfect Shoe! xxx
badge
Mostly offline, but trying.
mbmbmbmbmb
mkgray wrote:
simonh wrote:
Planned Project
I plan to use this to be able to create a "My Game Collection" database on my Palm PDA. My Palm App will allow me to filter by number of players, etc. to generate some recommendations for games to play.


Cool.


You going to share the app when you've built it?

That's a suggestion and a request, not a question.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
J
United States
Lexington
Kentucky
flag msg tools
admin
mbmbmbmbmb
be cool to get thread posts too in a nice programatic way, say all users that have posted in a thread and then all posts by user in a certain thread?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Sean Ross
Canada
North Vancouver
British Columbia
flag msg tools
designer
mbmbmbmbmb
I'd be interested in being able to access the Utilities/Statistics/Stats Analyzer functionality. I currently use the tool to find geekbuddies by collecting users who've rated games I've rated, and then running a script over the data to find users whose ratings are the shortest distance (Manhatten and Euclidean) from my own. The Stats Analyzer appears to have a limit on the number of games you can enter or the number of records you can return. Plus, entering all of your ranked games by hand can be a little tedious. So, in this case, I'm interested in pulling down my rated games, feeding those back into the Stats Analyzer, and working on the returned data. Being able to automate this process would be very much welcomed (at least, by me). Or, better yet, I understand that there used to be a correlation tool on the Geek that did this sort of thing for you - putting that back into operation might be the simplest solution.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Go Take A Hike
United States
Columbus
Ohio
flag msg tools
Where's the beef?!
badge
I don't think anybody's back there.
mbmbmbmbmb
Matthew,

Could there be a way to get some high level information about the games that have been posted to a specific geeklist?

I'm not so much interested in the comments themselves (although having that come along for the ride might be nice) but I'm more interested in the games on the list.

game id
game name
image id (maybe?)
average rating
overall rank
...

Thanks.





 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Melissa
Australia
Parkville
Vic
flag msg tools
admin
designer
May you find the Perfect Shoe! xxx
badge
Mostly offline, but trying.
mbmbmbmbmb
jmilum wrote:
be cool to get thread posts too in a nice programatic way, say all users that have posted in a thread and then all posts by user in a certain thread?


Can't imagine what that would be useful for, jmil ... laugh
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matthew Gray
United States
Reading
Massachusetts
flag msg tools
admin
mbmbmbmbmb
melissa wrote:
jmilum wrote:
be cool to get thread posts too in a nice programatic way, say all users that have posted in a thread and then all posts by user in a certain thread?


Can't imagine what that would be useful for, jmil ... laugh


Well, if someone would actually say what it would be useful for rather than hinting, I'm more likely to actually do something about it, as I mentioned in the first message. The RSS feeds already provide some of this, and I'm not clear what you're really after here...

 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
1 , 2 , 3 , 4 , 5  Next »  [53] | 
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.