8

I'm relatively new to XBox development and wanted to know the best place to start looking to learn more about what API are exposed by XBox Live. Specifically around player and game achievements, player details, other games they're playing - that sort of thing.

I've seen https://xboxapi.com and whilst that's good, I don't know if it will be detailed enough for what I need.

Similarly the XBox community development program (http://www.xbox.com/en-US/developers/home) seems to be quite useful but there's a lot to take on.

I'm hoping some kind hearted developer who has some experience can give a few pointers in the right direction to get me on my way

thanks,

crashmstr
  • 28,043
  • 9
  • 61
  • 79
Carl Sargunar
  • 577
  • 1
  • 5
  • 15
  • Can you please describe what data from the Achievements you need in your app/site? There are a bunch of tools and techniques out there, I just need to know in more detail the data you need. – Enijar Dec 13 '13 at 09:09
  • It's essentially for a specific game launch, so would be targeted at a single title, but it would be helpful to know what I can get. – Carl Sargunar Dec 13 '13 at 09:26
  • It's an RPG style game, so I guess could I display the player's level or skills or their in-app 'gold' value, could I purchase additional in-game currency, could I purchase in-game items – Carl Sargunar Dec 13 '13 at 09:27

3 Answers3

7

Based on your comments, then the Xbox API would be the most suited API for your app.

You can check the users recent games with an HTTP GET request:

https://xboxapi.com/profile/Focus+Jar

This will return a JSON array, where you can check if they have the game you would like to track their achievements on with this GET request:

https://xboxapi.com/achievements/1096157387/Focus+Jar

Using this method, you can use JavaScript or PHP and it's rather effective. I've used it before in an app. The only downside to this is that the XBOX API can sometimes be rather slow and for this I'd suggest caching some data form the GET Requests.

Hope this helps you more.

Update You now need an account to use this API.

Enijar
  • 6,387
  • 9
  • 44
  • 73
  • Thanks Enijar. I'm concerned that a third party app or service is another link in the chain, and I don't mind doing the development. Is there no direct service or API that XBox themselves will give me access to that I can make the same calls that XBoxAPI is calling? The speed is an issue too – Carl Sargunar Dec 13 '13 at 11:15
  • The info exposed by the achievements XBox API call is very similar to the thing I need for some of this work, but I have misgivings of going through an api to get to an api if I can cut out the middle man at all. Thanks, – Carl Sargunar Dec 13 '13 at 11:19
  • Microsoft don't provide an official API for Xbox, however you could make your own by parsing HTML for each users profile: https://live.xbox.com/en-GB/Profile?gamertag=Focus%20Jar – Enijar Dec 13 '13 at 11:52
  • If you're using PHP, there is a really good HTML parser here: http://simplehtmldom.sourceforge.net/ – Enijar Dec 13 '13 at 11:53
  • No, sadly it's a .net based app. – Carl Sargunar Dec 17 '13 at 12:21
  • Thanks for your replies, but I think I'm going to have to dig deeper into the problem and possibly join some programs to gain access. – Carl Sargunar Dec 17 '13 at 12:21
4

As far as I remember, there isn't much information given with the Xbox Community Developer Program. I originally wanted access to this information, but the application process takes a looooong time and they still haven't gotten back to me. I applied a few years back. I don't know if they're including anyone else in the program at this time. Therefore, I took matters into my own hands and started reverse engineering different ways to get the information I wanted.

I started off with writing a scraper in PhantomJS that sends all required fields to the login form and downloads the HTML/JSON once logged in. This worked for a while, but the way I built it, it was downloading an entire profile and storing the entire thing into an XML or JSON file. For people with 100+ games, this was very slow. I began looking for other methods of getting into xbox.com shortly after that.

The developer of xboxapi.com, djekl, and I are good friends since a few years back. Scraping is effective, but it's also daunting because if something changes in the HTML/JSON, things break. I have gone through several redesigns of my Xbox scraping library.

You'll need an HTTP library capable of capturing cookies from responses and sending them back in the next request. In PHP, cURL is quite good at doing this. I've noticed that in C#, the built-in HTTP library doesn't properly store the cookies between requests so you need to either manually manage the cookie header or use a .NET wrapper for libcurl such as LibCurl.Net.

I wish you best of luck on your project. It's a shame that we can't get an open API for this data from Microsoft. Maybe even a subscription based model would work if they were concerned about costs incurred by thousands of requests an hour to the API from different applications.

Cameron Tinker
  • 9,634
  • 10
  • 46
  • 85
  • 1
    Thanks for your help. Sounds like they're really not doing enough to help us devs. Silly really - more devs = cooler games = better experience. – Carl Sargunar Feb 01 '14 at 14:15
  • Yeah, it's too bad that they don't want to open up their data. I think Valve has the right idea with their Steam API. If only Microsoft and Sony could do the same. – Cameron Tinker Feb 03 '14 at 13:41
1

I've been working on my own API for the Xbox One and 360, I will be offering up some keys for beta access soon, if you are still looking for this kind of data or just want to talk about it, please feel free to jump on the gitter channel linked below.

Chat: https://gitter.im/playr-io/one

leafybasil
  • 11
  • 1
  • Hardly a useful answer, considering your own API is per your own words not yet usable to the general public, or the asker. –  May 02 '14 at 15:34
  • Actually I'm offering them access so it would be useful for them... They also asked for information/advice, I have plenty, more than belongs in an answer here. Probably should have added that he asked about granularity of data, I have documentation showing exact responses which would probably help answer his questions regarding that. – leafybasil May 02 '14 at 16:29
  • It still doesn't really constitute an useful answer, primarily because it lacks content. If you had even linked to the manual for your API - which is publicly available - it might've been possible to see if it fit the asker's needs. –  May 02 '14 at 16:32
  • That sounds like a personal opinion rather than a fact. They asked for "helpful" developers to provide direction, I've provided direction to a place where they can get as much or as little information as they want. Offering them access to the API seems likely to be exactly what they would want. – leafybasil May 02 '14 at 16:35
  • They sound very much like they are asking for a conversation about the general state of the available data, from various sources, not just for the data itself. I'm offering that conversation. I'll let @carlsargunar decide for himself. – leafybasil May 02 '14 at 16:42