gw2-api / issues

Issue tracker for the Guild Wars 2 API
https://discord.gg/zqeHCEg
16 stars 0 forks source link

Wizards Vault API Bugs/Suggestions #78

Open lambada opened 8 months ago

lambada commented 8 months ago

[Feedback gathered from GW2 API Dev Community after the WV API Release]

Localization problems

https://api.guildwars2.com/v2 shows /v2/wizardsvault/listings and /v2/wizardsvault/objectives as being localised.

Redundant data

Missing data

Stale Data

darthmaim commented 8 months ago

Kinda related: Only the weekly meta_reward_item_id is whitelisted, the daily chest is missing (https://api.guildwars2.com/v2/items?ids=99961,100137)

darthmaim commented 8 months ago

The objectives are missing the description that is visible in the tooltip ingame. image

It would maybe also be useful to some to get the astral acclaim and objective type icons added to /v2/files image image

sliekens commented 8 months ago

Suggestion: add ids=all to the root endpoint, to get an aggregate of all the listings and objectives.

GET https://api.guildwars2.com/v2/wizardsvault?ids=all&lang=en&v=latest
response ``` json { "title": "The Realm of Dreams Season", "start": "2022-11-07T17:00:00Z", "end": "2024-05-14T16:00:00Z", "listings": [ { "id": 1, "item_id": 101574, "item_count": 1, "type": "Featured", "cost": 500 }, { "id": 2, "item_id": 101617, "item_count": 1, "type": "Featured", "cost": 500 }, { "id": 3, "item_id": 101485, "item_count": 1, "type": "Featured", "cost": 150 }, ... ], "objectives": [ { "id": 1, "title": "Complete 3 Events", "track": "PvE", "acclaim": 10 }, { "id": 2, "title": "Compete in 1 Player vs. Player Team Battle", "track": "PvP", "acclaim": 10 }, { "id": 3, "title": "Complete 5 Bounty Missions in Crystal Oasis or Group Events", "track": "PvE", "acclaim": 50 }, ... ] } ```

@sliekens wouldn't it be kinda weird to use ids, because one might think ids=1 is then also possible?

I agree it's inconsistent with anything that came before it, other suggestions:

GET https://api.guildwars2.com/v2/wizardsvault?lang=en&v=latest
{
    "title": "The Realm of Dreams Season",
    "start": "2022-11-07T17:00:00Z",
    "end": "2024-05-14T16:00:00Z",
    "links": {
        "listings": "/v2/wizardsvault/listings?lang=en&v=latest",
        "objectives": "/v2/wizardsvault/objectives?lang=en&v=latest"
    }
}
darthmaim commented 8 months ago

I've played around with the Wizard's Vault endpoints for a week now (you can test my implementation here: https://en.gw2treasures.com/wizards-vault).

The biggest issue is obviously the need to login to the game before it returns data, but the second biggest issue I've noticed is the cache time. The authenticated objectives endpoints return a cache max-age of 60 minutes. Even when requesting with no-cache, data takes up to one hour to show up (fastest I've seen was about 5 minutes, average seems to be about 10 - 15 minutes). That makes the the endpoints basically useless to track daily objectives, because you will have completed all dailies before the endpoint even returns data for the correct day. The cache time should be dropped to max 5 minutes, better just 1 minute.

darthmaim commented 4 months ago

Just noticed that the /v2/wizardsvault/objectives endpoint sometimes returns (wrong) localized data, I suspect the language is missing in some cache key.

Yoone commented 4 weeks ago

Just noticed that the /v2/wizardsvault/objectives endpoint sometimes returns (wrong) localized data, I suspect the language is missing in some cache key.

I'm confirming this as well. These are requests made in a row (a few seconds apart), with the ?lang=fr query parameter, returning a different result every time. The same happens with the Accept-Language header, and all other languages.

What's worse is that the response headers include the content-language header, but its value is set to the requested language, not the actual language used in the response. So we can't query the API a bunch of times until we get the right one, in order to persist the results on our side.

$ curl 'https://api.guildwars2.com/v2/wizardsvault/objectives/1?lang=fr'
{
  "id": 1,
  "title": "Complete 3 Events",
  "track": "PvE",
  "acclaim": 10
}

$ curl 'https://api.guildwars2.com/v2/wizardsvault/objectives/1?lang=fr'
{
  "id": 1,
  "title": "Complete 3 Events",
  "track": "PvE",
  "acclaim": 10
}

$ curl 'https://api.guildwars2.com/v2/wizardsvault/objectives/1?lang=fr'
{
  "id": 1,
  "title": "Schließt 3 Events ab",
  "track": "PvE",
  "acclaim": 10
}

$ curl 'https://api.guildwars2.com/v2/wizardsvault/objectives/1?lang=fr'
{
  "id": 1,
  "title": "Terminer 3 événements",
  "track": "PvE",
  "acclaim": 10
}