Urgent.News

What's breaking now, across thousands of outlets.

Editions

Tech

Same API standard, four incompatible schemas: scraping state cosmetology license registries

"Just query the Socrata API" is true and also useless advice. Socrata SODA is a real open standard — New York, Connecticut, Colorado, and Texas all expose their professional-license registries through the same $limit / $offset / $where query language. The standard ends there. What each state puts inside that standard is four unrelated data models wearing the same protocol. Quick answer Every…

Despite sharing the same Socrata API standard, four states—New York, Connecticut, Colorado, and Texas—have four distinct schemas for their cosmetology license registries. The standard's structure remains unchanged, but the data within it varies significantly.

Each state's licensing information is presented in a single, unified table with unique column names, filter options, and definitions of what constitutes an "active" license. Texas does not provide a status column, rendering the active-only filter irrelevant in that state.

A generic Socrata client that assumes one schema will either miss crucial data or crash when encountering states with different column structures. To address this inconsistency, a per-state config object is necessary, mapping each state's real column names to a canonical output row format. The config should include the active-license filter, applicable only where the underlying data supports it.

The same Socrata query yields different professions across states because cosmetology licenses are embedded within each state's overarching professional-licensing table, alongside professionals from other fields like electricians, dentists, and notaries. Filtering must occur server-side, in SoQL, prior to pagination, or you risk downloading unnecessary rows and paying for storage of irrelevant data.

Texas requires a starts_with() match for three license-type prefixes and an additional wildcard search for establishments. In contrast, Connecticut needs an exact match for six specific credentials. Colorado demands an in() list of four codes to retrieve cosmetology licenses.

The presence of an active licenses only toggle is irrelevant in Texas due to the absence of a status column in its dataset. While New York, Connecticut, and Colorado each incorporate an active_where clause that is integrated into the query when active-only records are requested, Texas lacks any active_where clause, resulting in no applicable filtering.

One might expect a single "licensee name" column, but Colorado's registry lacks this convenience. Instead, the name must be derived from separate firstname and lastname columns at read time—a task that only applies to Colorado, as every other supported state already provides a unified name field.

Similarly, New York's address field is divided into two columns (business_address_1 and business_address_2), requiring concatenation for a complete address, while every other state supplies a single address field. The scraping of open-data from these states presents a considerable challenge due to these discrepancies.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Google Trends API: the 200 OK that means you got soft-blocked

Google Trends has no public API. What it has is the same internal JSON endpoints the trends.google.com single-page app calls — and those endpoints do something most REST clients aren't built to…

  • Google Trends returns 200 OK status with empty body when blocked
  • JSON responses contain inconsistent XSSI protection prefix
  • Endpoint renamed from multiGeo to comparedgeo without notice

5 states, 2 working filters: scraping US childcare license registries

Five states, one query language, and an "active licenses only" checkbox that only actually filters two of them. That's the trap in scraping US childcare-license open-data registries: Socrata SODA…

  • Capacity field is typed as int | str | None due to unreliable numeric data across states.
  • New York builds street address from two separate fields, unlike other states.

More from Friday 21 August →