Jump to content

  • Curse Sites
Help
- - - - -

API - Can I get my own from GW2 website?

api

  • Please log in to reply
14 replies to this topic

#1 Gunuin

Gunuin

    Fahrar Cub

  • Members
  • 15 posts

Posted 07 February 2013 - 08:53 AM

I played EVE for some time and I got into trading and loved the third party shareware that people had made, using the limited API I could access from the EVE website so that I could track my assets out of the game.

Does anyone know if this would be possible with GW2?  Does GW2 provide players with their limited APIs?  Are there third party apps to help me do this that don't cost money or would I have to create my own?

TIA!

#2 xtbx

xtbx

    Asuran Acolyte

  • Members
  • 128 posts
  • Guild Tag:[NR]
  • Server:Aurora Glade

Posted 07 February 2013 - 01:57 PM

http://www.gw2spidy.com/

#3 FoxBat

FoxBat

    Vigil Crusader

  • Members
  • 3929 posts

Posted 08 February 2013 - 01:13 AM

You can track the general trading post (the site above uses APIs to do so), but not your personal items etc.

#4 Daesu

Daesu

    Seraph Guardian

  • Members
  • 1344 posts
  • Guild Tag:[NPO]
  • Server:Fort Aspenwood

Posted 08 February 2013 - 01:14 AM

You can use the gw2spidy api or interface with the ArenaNet TP server directly.  Gw2spidy is just a "middle-man" between the ArenaNet trading server and whatever app you write.

Interfacing with ArenaNet server is a tad more complicated and your app would need your credentials to login before it can interface with it.  Either that or grab a temporary session key from a logined client and because you are logged in, you can use it to track your personal buy/sell orders which you cannot do using the gw2spidy api.

gw2spidy api: https://github.com/r...y/wiki/API-v0.9

There isn't any documentation out there for interfacing with ArenaNet's TP server that I know of.  The best way to learn it is to use fiddler to monitor the JSON http traffic between your GW2 client and the server when you are looking at TP data in the game.  Here is a very rudimentary and somewhat outdated info on it: http://www.unknownch...ading-post.html.  I use the ArenaNet's API to monitor if anyone is outbidding any of my buy orders, outside of the game so that I can up the ante.

Edited by Daesu, 08 February 2013 - 01:35 AM.


#5 Gunuin

Gunuin

    Fahrar Cub

  • Members
  • 15 posts

Posted 08 February 2013 - 07:04 AM

See that sounds really complicated.  By buddy might be able to help me out, just not sure when he would have the time.  Interesting to know that it is possible though.  Would love to see some apps come out to help players with this.  I know it has to take some time to make happen though.  Would be nice to have something that could even just calculate the value of my assets, or an app that I could use to take snap shots of all of my orders, to see how much I am really making.

I know I am making profit, but keeping my own spreadsheets is super time consuming, especially when I am working low volume items and tons of them.  Oh well.

Thank you though!

Edited by Gunuin, 08 February 2013 - 07:04 AM.


#6 Daesu

Daesu

    Seraph Guardian

  • Members
  • 1344 posts
  • Guild Tag:[NPO]
  • Server:Fort Aspenwood

Posted 08 February 2013 - 07:48 AM

You may want to start with the gw2spidy api since that is easier to code against and has reasonably good docs.  Ruben, the guy who set up gw2spidy, is super helpful and provides irc and mailing list support for his api.

Here is a link to his wiki: https://github.com/r...i/gw2spidy/wiki

There are code samples in github that use the api.  Here are some of Ruben's projects: https://github.com/r...ab=repositories

The gw2spidy api has several advantages over the ArenaNet TP api especially if you are looking into market trends:

1.  It has a daemon that captures buy/sell orders and you can get trend and volume data over time.  The ArenaNet TP api only gives what you see in the game, which is a snapshot, besides the gem sales trend.

2.  It incorporated gw2db data to offer some recipe information and their pre-calculated crafting cost.

3.  The api is better designed for market analysis and to support apps.  The ArenaNet TP api is  more designed for the GW2 game client (e.g. see point 4 below).

4.  For certain long list queries, the gw2spidy api is actually faster as it has the option to batch your results and return them in 1 long list.  Besides your personal buy/sell orders, the ArenaNet TP api only returns long item lists with 10 items at a time so you have to make multiple http gets.  In the game, you can only view 10 items at a time, from a long list.

5.  You don't need your login credentials to access the data.

The disadvantages of gw2spidy api compared to ArenaNet TP api are:

1.  You can't see your personal buy/sell transactions/orders as you are not logined..

2.  Because the gw2spidy api/website is very popular and Ruben has been busy, the server performance is terrible on certain days.  Queries fail sometimes and sometimes it returns error html data along with its JSON data.  I recommend coding in some fault tolerance in your code if you decide to use the gw2spidy api.

3.  The data is probably not as up-to-date as what you can get from ArenaNet TP server directly, if you care about that.

EDIT: Added pros/cons of using gw2spidy api versus ArenaNet TP api.

Edited by Daesu, 08 February 2013 - 04:46 PM.


#7 Azure Skye

Azure Skye

    Golem Rider

  • Members
  • 2048 posts
  • Location:(づ。*◕__◕。)づ・。*。✧・゜゜・。✧・。*。✧ Magic!
  • Profession:Mesmer
  • Guild Tag:[HEAT]
  • Server:Dragonbrand

Posted 08 February 2013 - 07:59 AM

I don't know, if you will find this useful, http://www.guildwars...request-thread/

#8 Daesu

Daesu

    Seraph Guardian

  • Members
  • 1344 posts
  • Guild Tag:[NPO]
  • Server:Fort Aspenwood

Posted 08 February 2013 - 08:11 AM

View PostAzure Skye, on 08 February 2013 - 07:59 AM, said:

I don't know, if you will find this useful, http://www.guildwars...request-thread/

I have requested on that thread but I didn't get a reply and I have not seen any api docs from them.  It seems their tooltip functionality uses JSON though, just have to parse the HTML string that gets returned.

Edited by Daesu, 08 February 2013 - 08:14 AM.


#9 Thaddeuz

Thaddeuz

    Sylvari Specialist

  • Members
  • 561 posts
  • Location:Canada
  • Guild Tag:[TRAP]
  • Server:Crystal Desert

Posted 08 February 2013 - 05:39 PM

For people that still don't understand how to use the API on gw2spidy. Here a little trick.

- Open Excel
- Open the ''Data'' tab
- Press ''From Text''
- In file name write : http://gw2spidy.com/...v/all-items/all
- Check ''Delimited'' then press next
- Check ''coma'' then press finish

This is basic and give you everything in the TP. Better ways exist, but its the easiest i know.

Good Luck

#10 silleke

silleke

    Pale Tree Seedling

  • New Members
  • 7 posts

Posted 08 February 2013 - 06:16 PM

View PostDaesu, on 08 February 2013 - 01:14 AM, said:

I use the ArenaNet's API to monitor if anyone is outbidding any of my buy orders, outside of the game so that I can up the ante.

Can i ask how you did this?

#11 Thaddeuz

Thaddeuz

    Sylvari Specialist

  • Members
  • 561 posts
  • Location:Canada
  • Guild Tag:[TRAP]
  • Server:Crystal Desert

Posted 08 February 2013 - 06:24 PM

View Postsilleke, on 08 February 2013 - 06:16 PM, said:

Can i ask how you did this?

Once you got the info on a spreadsheet of something similar its easy. He know his bid, he can search what is a highest bid and make the cell turn red each time the highest bid is higher than his own bid.

#12 Daesu

Daesu

    Seraph Guardian

  • Members
  • 1344 posts
  • Guild Tag:[NPO]
  • Server:Fort Aspenwood

Posted 08 February 2013 - 07:00 PM

View Postsilleke, on 08 February 2013 - 06:16 PM, said:

Can i ask how you did this?

First of all you need your GW2 client session key to access your personal TP transactions.  You can grab that by having your code scan the process memory of your Gw2.exe process after logging in.  You can also see your session key by running fiddler in the background as you open your TP dialog in the game.

Setup your cookie to use this session key then issue a GET request to
https://tradingpost-live.ncplatform.net/ws/me.json?time=now&type=buy&charid=<your charid guid>&offset=1&count=10
.  You can get your charid from fiddler or the Gw2.exe process memory in a similar way.  It will return your personal buy orders with buy_count, buy_price, datetime created, etc.

Then for each of these buy order, issue a GET request like this
https://tradingpost-live.ncplatform.net/ws/listings.json?type=buys&id=<item id>
where item id is the number id of the item in your buy order.  It will return listing, unit_price, and quantity for all the buy orders for the item.  You can then tell if you have been outbidded by someone else.

From the api, it seems that you may be able to cancel and issue buy orders outside of the game, assuming that you have enough gold, but I didn't try it.  That would be performing in-game operations outside of the game client and may just be bannable.  :) UPDATE: ok simple google search reveals that someone has already done it and it works *link to bot website removed, that figures*.

To see how all this work, you should install fiddler, run it in the background, login to the game and check each item in your buy order.  Then switch to the fiddler window and see the http requests that your GW2 game client issued.  Your app is just simulating the GW2 game client to the server using your own credentials.

Edited by Daesu, 08 February 2013 - 10:52 PM.


#13 El Duderino

El Duderino

    Golem Rider

  • Members
  • 2243 posts
  • Location:Drowning in a White Russian listening to Creedence
  • Profession:Mesmer
  • Guild Tag:[DuDE]
  • Server:Blackgate

Posted 09 February 2013 - 04:20 PM

Thanks for the advice Daesu. Do you know if running a program like fiddler is against the rules? Can it get you in trouble in any way that you know of?

#14 Daesu

Daesu

    Seraph Guardian

  • Members
  • 1344 posts
  • Guild Tag:[NPO]
  • Server:Fort Aspenwood

Posted 09 February 2013 - 09:32 PM

View PostPandora Misfit, on 09 February 2013 - 04:20 PM, said:

Thanks for the advice Daesu. Do you know if running a program like fiddler is against the rules? Can it get you in trouble in any way that you know of?

I would be surprised if using fiddler is against the rules.  Reuben (i.e. gw2spidy owner) used it to learn the api and checked with ArenaNet if it is ok to use their api for his website and ArenaNet cleared it.  Since ArenaNet has never officially published their API, the only easy way we could have found out about it is to use a tool like fiddler.

Edited by Daesu, 09 February 2013 - 09:33 PM.


#15 El Duderino

El Duderino

    Golem Rider

  • Members
  • 2243 posts
  • Location:Drowning in a White Russian listening to Creedence
  • Profession:Mesmer
  • Guild Tag:[DuDE]
  • Server:Blackgate

Posted 09 February 2013 - 09:38 PM

Perfect! Thank you!





Also tagged with one or more of these keywords: api

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users