I might try to go through the old suggestion thread this weekend and create issues for everything that deserves more discussion.
It’s great that you guys are finally using github, so that it’s easier for us to make suggestions, discuss features and follow updates than it is in a forum.
Don’t take the modulo 100 for the gold.
Those are awesome news!
Not all items are directly related to updates but get unlocked once they get ‘discovered’ by players in game. Some items will appear a few hours before the patch in the api but return errors until the patch goes live.
To always have up-to-date items you have to query the items api regularly and check for items that you don’t have in your database, since new items can be discoverer at any moment.
For https://gw2treasures.com I am currently checking https://api.guildwars2.com/v2/items every 10 minutes and diff it with my database, then adding all items that are new.
aswell as the WvW icons for forts, towers and camps
Especially these. We’ve been asking for those icons at least since the ruins icons have been added to the render service.
https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-World-vs-World/4345366
yes please! Please add all the WvW icons.
The list has been moved to http://wiki.guildwars2.com/wiki/API:List_of_applications.
If anything is outdated/wrong/missing, you can suggest it on the discussion page.
It is planned (https://api.guildwars2.com/v2/leaderboards) but not active yet.
When was the TP completely rewritten? Because they only stopped working on 2nd Dec.
https://www.guildwars2.com/en/news/introducing-the-new-trading-post/
I wish there was a call or a way to get the number of pages based on page size or some semblance of meta data.
There is the X-Page-Total Header
You could just split the request of too many items up into multiple requests and join them into one collection before returning them to the user.
But the RFC 2616 (3.2.1) says “The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs.” So the API really should be able to handle a request of 200 32bit Integers, so 2000 + the length of the endpoint url.
Awesome! I love how everything gets done now so fast and that you are active on the forum!
Its not the first time we get that many items. Checking my records we got roughly 1100 items on 2014-04-16 and 2000 items on 2014-02-18.
Its the same for all other languages, even if those don’t have such a nice helper function built in, you can always write it yourself. Since querying the API will almost always be slower than what you are doing with the data once you got it, your code doesn’t even need to be super fast.
Well, its just one line more to do it with the current api if you need to that:
$requestedIDs = [ 123, 456, 789 ];
$result = getItemsFromApi( $requestedIDs ); // builds the url, requests it and decodes the json
$result = array_column( $result, null, 'item_id' ); // this is new
foreach( $requestedIDs as $id ){
$item = $result[ $id ];
// do stuff
print_r($item);
}
Well, it doesn’t matter if you loop over your id’s or the result, both is O(n) and should take exactly the same time. You can build your dictionary there to later access specific items of the result with a complexity of O(1). If you don’t want to access all items you request, you shouldn’t request them in the first place.
Well, in most cases you are looping at least once over all items returned and you can build your dictionary there, so it in the end, it doesn’t even matter.
Can confirm, X-Result-Count and X-Result-Total are still missing. Just in case you missed it, we are talkin about the X-Result headers, not X-Page, those are working fine now.
Edit: guess i was too slow.
Using a too large page_size will return the max amount of objects returned by the api in the error message, for example https://api.guildwars2.com/v2/commerce/listings?page=0&page_size=1000 returns 200
Here is the new link for a snapshot of the item database behind gw2treasures: http://gw2treasures.de/2014-09-09_items.sql.gz
Sorry that it took me so long, i was at work.
I don’t think its intended, when accessing https://api.guildwars2.com/v2/commerce/listings?page=1000 (page out of range), it tells you how many pages there are, so the information is definitely there.
https://api.guildwars2.com/v2/commerce/listings doesnt send X-Result-Count and X-Result-Total headers like the quaggan API
Started to make a better overview of new items, but still much work to do: http://gw2treasures.de/stats/items/new
Unlocking items in the api is complicated.
Some items just never appear, mostly karma items (see this). Some items just appear after they were moved out of your inventory (mail/trading post/vault/…)(source). After an update it takes about 1 week to discover most of the items. And sometimes anet is resetting the discovered status of all items, so that they have to be discovered again to show up in the api (that happened just once for now? cant find source anymore).
In case you are interested, here is a RSS feed for all renamed items: http://gw2wbot.darthmaim.de/rss/renamedItems/
And here are the recently added ones: http://gw2treasures.de .
I still need to make a better overview for that.
(edited by darthmaim.6017)
This is awesome, tomorrow i will see what evil fun stuff i can do with it :P
Probably because of:
DISCLAIMER: This API is not an official-release API and is not intended for public use. Therefore, it is unsupported by Arenanet, NCsoft or any other company. It is subject to change without any notification. USE AT YOUR OWN RISK.
glad you like it
For everyone with dark websites i added a dark style, just add ?style=dark to the url
Here ya go: http://dev.gw2treasures.de/doc/embedWorldStats.
Please tell me if you have any feature requests, ‘aye that would be great’ is nothing i can implement :P
Time until reset is one of the things i definitely want to add yet.
I just made a quick overview for WvW here: http://gw2treasures.de/wvw.
If you guys tell me what you all need in the embedded version i can implement that tomorrow :)
we track item renaming -> http://gw2wbot.darthmaim.de/rss/renamedItems/
)
I have a small note regarding to your RSS feed. My browser is not recognizing the feed when opening it (Firefox). The problem seems to be the Content-Type header your server sends. Try changing it from “application/json” to “application/rss+xml”.
On the other hand, although I’m not sure in which cases it can be useful, you did a good job there!
fixed