Skip to content

fix: RotherhamCouncil - rewrite for Imactivate API (postcode + paon)#1981

Closed
InertiaUK wants to merge 1 commit into
robbrad:masterfrom
InertiaUK:fix/rotherham-imactivate-api
Closed

fix: RotherhamCouncil - rewrite for Imactivate API (postcode + paon)#1981
InertiaUK wants to merge 1 commit into
robbrad:masterfrom
InertiaUK:fix/rotherham-imactivate-api

Conversation

@InertiaUK
Copy link
Copy Markdown
Contributor

Rotherham's own bin-day page (rotherham.gov.uk/bin-collections) directs residents to PDF calendars only — there is no usable web lookup. The data behind the Rotherham Bins Android app comes from the shared Imactivate backend at bins.azurewebsites.net. Earlier in the year that endpoint had no Rotherham data deployed; as of April 2026 it does:

  • GET /api/getaddress?postcode=S60+1JD&localauthority=Rotherham returns the full address list with PremiseID per row.
  • GET /api/getcollections?premisesid=<id>&localauthority=Rotherham returns the upcoming schedule (PINK / BLACK / GREEN bins).

The existing scraper only accepted a pre-resolved premisesid (or treated a numeric uprn as one). Standard UPRNs are not Imactivate PremiseIDs and yield empty results, which is why the test had been failing. Rewritten to accept postcode + paon:

  1. Resolve PremiseID via getaddress, matching against Address1 / Address2 / Street, with a looser substring fallback for compound addresses like Flat 3, 22A.
  2. Fetch the schedule via getcollections.
  3. Still honour an explicit premisesid kwarg if passed.

input.json updated to use postcode: S60 1JD + paon: 77 so the parity check stays green and the integration test can exercise the live API. Verified end-to-end: returns 6 future collections.

Rotherham's own bin-day page directs residents to PDF calendars only —
there is no usable web lookup at rotherham.gov.uk. The Rotherham Bins
mobile app uses the shared Imactivate backend at
`bins.azurewebsites.net`. Earlier this year that endpoint had no
Rotherham data deployed; as of April 2026 it does:

- `getaddress?postcode=S60+1JD&localauthority=Rotherham` returns the
  full address list with `PremiseID` per row.
- `getcollections?premisesid=<id>&localauthority=Rotherham` returns
  6 future collections (PINK / BLACK / GREEN bins) per property.

The previous scraper only accepted a `premisesid` (or treated a numeric
`uprn` as one), but standard UPRNs are not Imactivate PremiseIDs and
yield empty results. Rewritten to accept `postcode` + `paon`, resolve
the PremiseID via getaddress (matching against Address1 / Address2 /
Street with a substring fallback for compound addresses like
"Flat 3, 22A"), then fetch the schedule. `premisesid` is still
honoured if explicitly passed.

`input.json` updated to use postcode `S60 1JD` + paon `77` so the
parity check stays green and the integration test can hit the live API.

Verified: returns the full upcoming bin schedule.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@InertiaUK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 54 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 57 minutes and 54 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ef354fc-587e-453d-bfa2-2692ad45fae3

📥 Commits

Reviewing files that changed from the base of the PR and between 60bd3cc and 25cd4fe.

📒 Files selected for processing (2)
  • uk_bin_collection/tests/input.json
  • uk_bin_collection/uk_bin_collection/councils/RotherhamCouncil.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@robbrad robbrad mentioned this pull request May 1, 2026
@robbrad
Copy link
Copy Markdown
Owner

robbrad commented May 1, 2026

Included in May 2026 Release PR #1992. Closing.

@robbrad robbrad closed this May 1, 2026
@robbrad robbrad mentioned this pull request May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants