Rank surgeons by procedure
This guide builds a ranked list of clinicians who perform a given procedure in a given state, then pulls a full profile for the top name. The first three steps spend 3 credits.
1. Find the code
Section titled “1. Find the code”curl "$OPH_API/api/procedures?q=knee%20arthroplasty" -H "Authorization: Bearer $OPH_KEY"Take the code of the row you want. Total knee replacement is 27447.
2. Rank clinicians
Section titled “2. Rank clinicians”curl "$OPH_API/api/providers?hcpcs=27447&state=AZ&min_services=50&limit=50" \ -H "Authorization: Bearer $OPH_KEY"Rows come back sorted by services, highest first. min_services drops occasional operators.
To narrow to one metro, add city=Phoenix. The match is on the whole city name, so Phoenix will not return Scottsdale; run one call per city.
3. Profile the top name
Section titled “3. Profile the top name”curl "$OPH_API/api/providers/1234567893" -H "Authorization: Bearer $OPH_KEY"The parts a rep usually wants:
procedures: the rest of their case mix, withplace_of_serviceshowing hospital (F) against office (O).groups: the practice to route the account to.payments: which manufacturers already pay them, and how much.
4. Export the whole list
Section titled “4. Export the whole list”The search returns up to 200 rows a page. For every clinician that matches, send the same filters to exports (10 credits):
curl "$OPH_API/api/exports" \ -H "Authorization: Bearer $OPH_KEY" -H "Content-Type: application/json" \ -d '{"list": "providers", "params": {"hcpcs": "27447", "state": "AZ", "min_services": 50}}'The response has a url to a CSV with the same columns as the search.
A figure the search does not return
Section titled “A figure the search does not return”For something the search has no column for, such as each surgeon’s share of cases done in a hospital, ask in plain English (25 credits):
curl "$OPH_API/api/ask" \ -H "Authorization: Bearer $OPH_KEY" \ -H "Content-Type: application/json" -H "Accept: application/json" \ -d '{"question": "For the top knee replacement surgeons in Arizona, what share of their cases are done in a facility?"}'Each tile in the answer carries the sql the model wrote, so you can see how the share was computed.