WoW Profile Achievements endpoint slow?

Hi all – I noticed that the Achievements endpoint seems to be hanging up my application. I have an API Call function that runs about 6 times on different endpoints. Everything seems to be working smoothly, 5 out of 6 complete in less than a fraction of a second.

The achievements endpoint usually takes (at best) a couple seconds, or (at worst) up to 10-15 seconds. I used a stopwatch class to demonstrate this:

https://us.api.blizzard.com/profile/wow/character/{realm}/{character}/pvp-bracket/2v2?namespace=profile-us
Runtime 00:00:00.25
https://us.api.blizzard.com/profile/wow/character/{realm}/{character}?namespace=profile-us
Runtime 00:00:00.26
https://us.api.blizzard.com/profile/wow/character/{realm}/{character}/character-media?namespace=profile-us
Runtime 00:00:00.26
https://us.api.blizzard.com/profile/wow/character/{realm}/{character}/pvp-bracket/rbg?namespace=profile-us
Runtime 00:00:00.25
https://us.api.blizzard.com/profile/wow/character/{realm}/{character}/pvp-bracket/3v3?namespace=profile-us
Runtime 00:00:00.26
https://us.api.blizzard.com/profile/wow/character/{realm}/{character}/achievements?namespace=profile-us
Runtime 00:00:09.30

Anyone notice this as well? I don’t think my API Call is busted since it works on all of the others just fine. Tried this over the past 48 hours and same results.

I should also be well within the rate-limits.

Sometimes the API transfer rate is slow (under 50KBps), and the achievement endpoint response is large. Make sure you’re using gzip transfer encoding to reduce the number of bytes on the wire.

1 Like

Gzip? I will look into that. Thank you!

Update: This seems to have helped a lot! I ran about 10 sets of 6 API calls and while 5/6 of them remained at .25sec , the achievement API call stayed under 3 seconds every time, and usually took only 1-2. No more 10 second waits :slight_smile:

Here’s my C# method in case this helps anyone else.

        private async Task<string> Call(string uri, Namespace space) // API Lookup, returns a json string to calling function
        {
            uri += $"?locale={this.Config.locale}"; // Get data for current locale only
            using (var request = new HttpRequestMessage(new HttpMethod("GET"), uri))
            {
                switch (space)
                {
                    case Namespace.Profile:
                        request.Headers.TryAddWithoutValidation("Battlenet-Namespace", $"profile-{this.Config.Region}");
                        break;
                    case Namespace.Static:
                        request.Headers.TryAddWithoutValidation("Battlenet-Namespace", $"static-{this.Config.Region}");
                        break;
                    case Namespace.Dynamic:
                        request.Headers.TryAddWithoutValidation("Battlenet-Namespace", $"dynamic-{this.Config.Region}");
                        break;
                }
                request.Headers.TryAddWithoutValidation("Accept-Encoding", "gzip, deflate"); // Request compression
                request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {this.Config.Token.access_token}");
                var client = this.ClientFactory.CreateClient();
                client.Timeout = TimeSpan.FromSeconds(20); // Set HTTP Request Timeout
                var response = await client.SendAsync(request); // Send HTTP Request
                return await response.Content.ReadAsStringAsync(); // Return JSON
            }
        }