Thiraz.4279 Posted June 30, 2018 Share Posted June 30, 2018 My web app used to work fine for weeks and suddently I get bad request errors when getting data from the API. I usually get an error between the second and the 5th pages requested. It happens on the production server and in my home development environment. Here is the website: http://gw2priceanalyzer.azurewebsites.net/ Here is the code to get the data: public static IQueryable ListItemDetails { get; private set; } public static IQueryable ListPriceDetails { get; private set; } public static async Task GetData() { using (var webClient = new WebClient()) { var tempPrices = new List(); var tempItems = new List(); var jsonData = await webClient.DownloadStringTaskAsync("https://api.guildwars2.com/v2/commerce/prices/"); var listItems = JsonConvert.DeserializeObject>(jsonData); var totalPagesCount = listItems.Count / 200; for (var pageCount = 0; pageCount <= totalPagesCount; pageCount++) { jsonData = await webClient.DownloadStringTaskAsync($"https://api.guildwars2.com/v2/commerce/prices?page={pageCount}&page_size=200"); tempPrices.AddRange(JsonConvert.DeserializeObject>(jsonData)); jsonData = await webClient.DownloadStringTaskAsync($"https://api.guildwars2.com/v2/items?page={pageCount}&page_size=200"); tempItems.AddRange(JsonConvert.DeserializeObject>(jsonData)); } ListPriceDetails = tempPrices.AsQueryable(); ListItemDetails = tempItems.AsQueryable(); } return true; } Link to comment Share on other sites More sharing options...
Wanze.8410 Posted July 1, 2018 Share Posted July 1, 2018 The Wiki has a warning atm: > The Guild Wars 2 API is experiencing difficulties this weekend, which may affect various pages on this wiki such as Dailies, Trading post prices and Maps. Link to comment Share on other sites More sharing options...
Thiraz.4279 Posted July 1, 2018 Author Share Posted July 1, 2018 thank you for the information :) Link to comment Share on other sites More sharing options...
Thiraz.4279 Posted July 2, 2018 Author Share Posted July 2, 2018 It fixed by itself :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now