Skip to content

fix(gumtree): South Africa ids are refs — widen id types, 0.60.1 (SCR-295) - #64

Merged
0xGhostCasper merged 1 commit into
mainfrom
scr-295-gumtree-za-refs
Oct 13, 2026
Merged

0xGhostCasper merged 1 commit into
mainfrom
scr-295-gumtree-za-refs

Conversation

@0xGhostCasper

Copy link
Copy Markdown
Member

Why

gumtree.co.za replaced its old site with a new Nuxt app on 2026-10-12. The API now serves market="za" from the site's new JSON API (scrape-badger/scrapebadger#2461, deployed). Category, location and listing ids there are refs, not numbers:

  • p6dnh is Cars & Bakkies.
  • dkp8y is Gauteng.
  • ls26bvmcpnsqmz7l9jz is a listing.

0.60.0 typed those ids as int, so every za tree, facet, suggestion and location-suggestion response failed validation.

Change

  • These fields go from int to int | str: TreeNode.id, TreeResponse.id, CategoryRef.id, CategoryFacet.id, LocationSuggestion.id, category_id (search response, listing summary, listing detail) and category_ids.
    • uk/au responses still parse to ints, and callers passing ints are unaffected.
  • list_categories / list_locations take parent_id: int | str, so za refs can be passed.
  • Docstrings and examples use real za values:
    • search(market="za", category="p6dnh", location="dkp8y", filters="make:toyota")
    • filter keys make / model / fuelType / year / mileageKm
    • the 375-match paging window
    • listing refs
  • Field descriptions updated: price_type za values ASKING_PRICE / POA; short_id, lifetime_listings and total_views are no longer published; za member_since_year.
  • Tests:
    • The za fixtures in tests/fixtures/gumtree_samples.json were re-captured from the live API on 2026-10-13 (search, listing, and a za category tree with string ids). uk/au fixtures are untouched.
    • New tests cover za string ids, uk int ids, and passing a za ref as parent_id.
  • Version 0.60.1 (pyproject.toml, __version__, SDK_VERSION, uv.lock) with a CHANGELOG entry.

Checks

ruff check, ruff format --check, mypy src/ (224 files, no issues) and pytest --ignore=tests/e2e: 870 passed, 41 of them gumtree.

Linear: SCR-295

🤖 Generated with Claude Code

…-295)

gumtree.co.za re-platformed on 2026-10-12 and the API now serves market="za"
from the new site, whose category, location and listing ids are refs
('p6dnh', 'dkp8y', 'ls26bvmcpnsqmz7l9jz'). 0.60.0 typed those ids as int, so
every za tree / facet / suggestion response failed validation.

- TreeNode.id, TreeResponse.id, CategoryRef.id, CategoryFacet.id,
  LocationSuggestion.id, category_id and category_ids are int | str
  (uk/au still return ints; int callers are unaffected)
- list_categories / list_locations take parent_id: int | str
- docstrings and examples use real za refs and filter keys (make:toyota …)
- za fixtures re-captured from the live API on 2026-10-13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@0xGhostCasper
0xGhostCasper merged commit 09682d8 into main Oct 13, 2026
7 checks passed
@0xGhostCasper
0xGhostCasper deleted the scr-295-gumtree-za-refs branch October 13, 2026 18:04
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