Henrik-3 / unofficial-valorant-api

Unofficial VALORANT API using the VALORANT Ingame API
442 stars 19 forks source link

matches endpoint sometimes doesn't return anything when a filter is applied #37

Closed MaximumMaxxx closed 2 years ago

MaximumMaxxx commented 2 years ago

Atleast right now if you search Anything#6969 into the matches end point with the competitive filter it like https://api.henrikdev.xyz/valorant/v3/matches/na/Anything/6969?filter=competitive it silently returns nothing. My best guess for why this happens if because they haven't played competitive in a while.

Output: Nothing Expected: Http error code

MaximumMaxxx commented 2 years ago

https://user-images.githubusercontent.com/77695343/143536077-e2e452ff-3c8b-418f-95c3-0eb525cf5e8c.mp4

Henrik-3 commented 2 years ago

Hey, what you see is a status code 204 (No Content) which i used as an "error" handling code when the VALORANT API haven't existed and i started with coding (which was stupid to be honest) and should be considered as a bug. Your guess was right, a 204 comes up when there is no data available, normally (or better in the future) it should return the following:

{
    "status": 200,
    "data": []
}

I planned to recode the whole API before the start of 2022 to TypeScript and in general fix errors like the 204 status code and also add a real documentation then (a swagger or OpenAPI docs also).

Henrik-3 commented 2 years ago

https://github.com/Henrik-3/unofficial-valorant-api/blob/main/v2_changes.md