API talk:2/commerce/prices
Get Some[edit]
- So... whats the best way to get all the Buy/Sell to update MySQL database of just weapons?
Pulling Data[edit]
<?php
$url = "ht tps://api.guildwars2.com/v2/commerce/prices/19684";
$string = file_get_contents($url); $next = json_decode($string, true); $response = array($next);
foreach ($response as $value) {
echo var_dump($value);
}
This results in a NULL instead of the expected results. Why? What has changed since last time I was working on this api? ```` —The preceding unsigned comment was added by Reanne (talk).
Quantity limit for multiple ids[edit]
For multiple ids, it was only able to return 22 ids at a time. Is this known to be a fixed limit, or will it change with server load, or some other factor? Should I code for individual id queries rather then combining the ids into groups of 20 to reduce calls on the server? e.g., 110 individual id queries vs. 5 queries of 22 ids. Separ (talk) 18:06, 10 June 2025 (UTC)
- Update on above: I used this query http://api.guildwars2.com/v2/commerce/prices?ids=49424,49425,49426,49427,49428,49429,49430,49431,49432,49433,49434,49435,49436,49437,49438,49439,49440,49441,49442,49443,49444,49445,49446,49447,49448,49449,49450,49451,49452,49453 to return costs for AR+1...AR+30 infusions, but only got back the items through AR+22 (item 49445), but when I executed this query to get the rest: http://api.guildwars2.com/v2/commerce/prices?ids=49446,49447,49448,49449,49450,49451,49452,49453 i received the error: "all ids provided are invalid" even though those are the ids listed in the wiki. I will experiment a bit more and update this topic. Separ (talk) 18:23, 10 June 2025 (UTC)
- I don't know what you're doing wrong, but Widget:Map bonus rewards/script.js routinely pulls 106 results in the same query without issue, i believe the limit is still 200 for this endpoint. Might be a limit for the number of item ids not sold? -Chieftain Alex
19:33, 10 June 2025 (UTC)
- I don't know what you're doing wrong, but Widget:Map bonus rewards/script.js routinely pulls 106 results in the same query without issue, i believe the limit is still 200 for this endpoint. Might be a limit for the number of item ids not sold? -Chieftain Alex