CaptEmulation/clash-of-clans-api

Ip address

rikarsen opened this issue · 4 comments

how to get my localhost ip address to create token?

it says
GET https://api.clashofclans.com/v1/clans/%23UPC2UQ 403 (Forbidden)
Fetch API cannot load https://api.clashofclans.com/v1/clans/%23UPC2UQ. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

@rikarsen very sorry that I missed your latest comment-- I have been travelling internationally and very busy. I am trying to better understand your problem. Can you create a gist that demonstrates this issue? I do not seem to be having this problem.

If you are attempting to run this code in a browser then it will not work because of the CORS issue. You can use https://github.com/CaptEmulation/coc-api-proxy to create a CORS-less proxy to https://api.clashofclans.com. If you are running in NodeJS there should be no CORS issue and it should Just Work(tm)