covid-tracking-api
covid-tracking-api copied to clipboard
US Endpoint blocked by CORS policy
Access to fetch at 'https://covidtracking.com/api/us' from origin 'https://www.richcorbs.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
@richcorbs i found that adding .json
to the end of the url fixed this. Some redirect rule gone awry I suspect.
Looks like the redirect doesn't provide the Access-Control-Allow-Origin. I've disabled the redirect.
Last week the states/daily
end point stopped working with .json
and the solution was to remove it. The us
end point continued to work with .json
but I removed it for consistency sake and it continued to work.
Today I learn that us.json
is right and states/daily.json
works again too.
Hard to work with a moving target. What is the right/official way to use the API? I see in the documentation today that .json
seems to be preferred. Is that correct?