E. Strathmeyer
United States
California
flag msg tools
mbmbmbmbmb
Not sure what the right forum is for this. This post is intended for any programmers, but especially front-end JS programmers.

I've created a caching proxy for the BGG API that returns JSON instead of XML. Here it is giving The Hotness data:
http://bgg-api.herokuapp.com/api/v1/hot

The best thing is that I've enabled CORS headers, so you can use the API straight from the web browser. Here's an example that gets The Hotness data via jQuery and then displays it:
http://jsfiddle.net/8rS2v/1/

All of the methods that are listed on the BGG API wiki page work.

Parameters are passed as HTTP GET query params:
http://bgg-api.herokuapp.com/api/v1/collection?username=stra...
http://bgg-api.herokuapp.com/api/v1/search?query=crocodile+p...

Successful queries are cached for 6 hours, so repeated requests will not hit the BGG servers.

Of course, no guarantees of uptime, but I'll try to give advance warning here if I have to take it down.

Play around with it! Let me know if you have any feature requests.

(For the curious, it's a hapi.js app running on node and backed by redis. Code is here: https://github.com/strathmeyer/node-bgg-api/blob/master/inde...)
  • [+] Dice rolls
Justin Shearer
United States
South Carolina
flag msg tools
You sir are a gentleman and a scholar. I'm putting a little something together for you.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
MokuJin ZergMan
France
flag msg tools
badge
Avatar
mbmbmbmbmb
Perfect !!
It works !!

Exemple with JQuery : search games "Dominion"

$.ajax({
method: "GET",
dataType : "json",
url: "http://bgg-api.herokuapp.com/api/v1/search",
data:{
query:"Dominion"
},
success: function(oResult)
{
console.log(oResult);
// Do Some Stuff
},
error : function(oResult)
{
console.log("Error" + oResult);
}
});
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jim Sullivan
United States
Forest Hills
New York
flag msg tools
badge
Avatar
mbmbmbmbmb
This is very helpful. Thanks for doing it!

FYI: 202 responses are getting stuck in the cache. It's easy to work around this by adding &attempt=1, &attempt=2, etc to the requests. I'm tempted to fork your repo and see how hard it would be to only cache 200 responses. But I've never worked with hapi or CoffeeScript, so that might be tough for me
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
E. Strathmeyer
United States
California
flag msg tools
mbmbmbmbmb
JimbNYC wrote:
FYI: 202 responses are getting stuck in the cache.

Doh! Thanks for letting me know.

I'll try to fix that this week.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jeremy Moritz
United States
Shawnee
Kansas
flag msg tools
mbmbmbmbmb
Is there a way to make this work with GeekLists?

I would love to get this geeklist api working with JSON and no CORS issue!

https://www.boardgamegeek.com/xmlapi2/geeklist/205279

Thanks for your help!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
D Ng
msg tools
Hi, I am doing a school project and I would like to use the api from BGG. Is there a JSON API that allows me to search by the game name not game id? Thanks a lot!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Maarten Ronteltap
Netherlands
Leiden
Zuid-Holland
flag msg tools
An Arab and a Spaniard playing chess in a tent. Miniature from Libro de los Juegos ("Book of Games"), commissioned by Alfonso X in Toledo (Spain), 1283.
Avatar
mbmbmbmbmb
Is it just me or is this not working anymore? I'm receiving "404" errors!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
E. Strathmeyer
United States
California
flag msg tools
mbmbmbmbmb
EmperorAtahualpa wrote:
Is it just me or is this not working anymore? I'm receiving "404" errors!

Not just you. I haven't maintained this in years.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Maarten Ronteltap
Netherlands
Leiden
Zuid-Holland
flag msg tools
An Arab and a Spaniard playing chess in a tent. Miniature from Libro de los Juegos ("Book of Games"), commissioned by Alfonso X in Toledo (Spain), 1283.
Avatar
mbmbmbmbmb
strathmeyer wrote:
Not just you. I haven't maintained this in years.

Oh. Sorry to hear about this. You lost interest? Or was there another problem?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Aaron Klaser
United States
Missouri
flag msg tools
can i have your source code? I would like to this project over. aaron.klaser@gmail.com
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jeremy Moritz
United States
Shawnee
Kansas
flag msg tools
mbmbmbmbmb
+1: That would be wonderful! I really hope the original developer shares this with you if you have the capability of hosting it. Thank you!
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
jelle schouwstra
Netherlands
flag msg tools
mbmb
Does anyone know if there's an update about this?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
E. Strathmeyer
United States
California
flag msg tools
mbmbmbmbmb
aaronklaser64 wrote:
can i have your source code? I would like to this project over.

Source code is linked in the original post. (https://github.com/strathmeyer/node-bgg-api) Feel free to fork it!

I have no current plans to update this code.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls