SanderBlom / BIR_Waste_Watch

An home assistant integration that scrapes bir.no for your waste collection dates (mixed, plastic, paper, etc)
0 stars 0 forks source link

Investigate the possibility to use the API #10

Open SanderBlom opened 4 months ago

SanderBlom commented 4 months ago

After some investigation, I figured out that the BIRs mobile app use the https://webservice.bir.no/api/ API. To be able to use the API we will first have to login using POST https://webservice.bir.no/api/login with a body that contains the applikasjonsId and the oppdragsgiverId. ATM i'm not sure if the applikasjonsId is uniquely generated on each device or if this is a static ID that is hard coded in the application.

If the applikasjonsId is hardcoded or we can easily generate it, we could change the integration to call the API directly instead of scraping the website for the same information.

SanderBlom commented 2 months ago

Looks like the applikasjonsId is hardcoded. I will try when I have time to refactor the integration to call the API instead of using the webscraper