Skip to content
N1
Integrations · API-less state portal

Court-case search on a portal with no public API

Client: sattar.kz Category: Integrations Stack: PHP, cURL, DOMDocument/DOMXPath, JSF session emulation Timeline: 1–2 weeks
Problem

At sattar.kz, counterparty court cases needed to be searched programmatically on a state court portal — there is no public API, only a dated JSF/RichFaces web interface.

Constraints

The portal runs on a legacy Java/JSF stack with no REST: form field IDs and markup shift between portal releases, and authentication relies entirely on session state.

What I did
  • Browser session emulation: a cookie jar plus handling of the JSF ViewState and Ajax partial-response
  • Login and case search by party name with court and year filters
  • A DOMXPath result parser with cascading selectors and fallback strategies for markup changes
  • Deduplicating results and returning structured JSON instead of raw HTML
  • Configuration moved into constants for quick re-tuning without touching the parsing logic
Architecture
Court portal (JSF/RichFaces) Session emulation XPath parser JSON API
Result

Searching for a counterparty's cases became a programmatic JSON call instead of a manual trip to the portal, resilient to small markup changes thanks to fallback parsing.

What can be reused
Pattern for emulating a legacy JSF portal with no REST API XPath parsing with graceful fallback on markup changes Scraping-result deduplication