Home > Mobile >  An API request from my app has been blocked but still works from a browser
An API request from my app has been blocked but still works from a browser

Time:11-22

The API request "https://www.vattenfall.se/api/price/spot/pricearea/2022-02-09/2022-02-15/SN3" works from a browser but not when using: "curl -i -X GET https://www.vattenfall.se/api/price/spot/pricearea/2022-02-09/2022-02-15/SN3"

It work some days ago but now suddenly it is blocked.

It would be great if there is anyone that can give me some clues on what's wrong here and if there is a solution.

CodePudding user response:

I think this api is looking for user-agent. Try this.

curl -i -X GET https://www.vattenfall.se/api/price/spot/pricearea/2022-02-09/2022-02-15/SN3 --header 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'```

  • Related