Backwork Spending API
Medicare spending and utilization by billing code
Medicare spending and utilization by billing code
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/backworkhealth-com:backworkhealth-com-spending-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Backworkhealth Com Spending API
version: 1.0.0
contact:
email: support@backworkhealth.com
url: https://backworkhealth.com
license:
name: Proprietary
url: https://backworkhealth.com/terms
description: 'Operations tagged Spending across 2 of this provider''s published API definitions: backworkhealth-com-openapi.json, backworkhealth-com-v1-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://backworkhealth.com/api/v1
description: Production server
- url: http://localhost:3000/api/v1
description: Local development
security:
- bearerAuth: []
tags:
- name: Spending
description: Medicare spending and utilization by billing code
paths:
/spending/by-code:
get:
tags:
- Spending
summary: Get Medicaid spending by code
description: Returns aggregate Medicaid provider spending statistics per HCPCS code, including totals and year-over-year breakdowns from CMS claims data. Provide `code` or `codes`. Requested codes with no data return zeroed totals. Patient counts are publisher row-level sums, not deduplicated people.
operationId: getSpendingByCode
parameters:
- name: code
in: query
description: Single HCPCS code to look up
required: false
schema:
examples:
- T1019
type: string
minLength: 1
maxLength: 10
- name: codes
in: query
description: Comma-separated list of HCPCS codes (max 10)
required: false
schema:
examples:
- T1019,T1020
type: string
maxLength: 100
- name: year
in: query
description: Filter the yearly breakdown to a specific year
required: false
schema:
examples:
- 2023
type: integer
minimum: 2000
maximum: 2100
responses:
'200':
description: Spending data keyed by HCPCS code
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
const: true
data:
type: object
propertyNames:
type: string
additionalProperties:
$ref: '#/components/schemas/CodeSpendingData'
meta:
type: object
properties:
request_id:
type: string
description: Unique request identifier for tracing
timestamp:
type: string
format: date-time
description: Response timestamp
codes_requested:
type: integer
patient_count_semantics:
type: string
const: sum_of_source_row_counts_not_distinct_people
description: Patient counts are summed at publisher row grain and are not deduplicated people
patient_count_disclosure:
type: string
year_filter:
type: integer
required:
- request_id
- timestamp
- codes_requested
- patient_count_semantics
- patient_count_disclosure
required:
- success
- data
- meta
'400':
description: 'Error: `VALIDATION_ERROR`'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: VALIDATION_ERROR
message: Request validation failed
hint: Fix the fields listed in details, then send the corrected request
docUrl: https://backworkhealth.com/docs/errors#validation-error
retryable: false
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
'401':
description: 'Error: `AUTH_MISSING`, `AUTH_INVALID_FORMAT`, `AUTH_INVALID_TOKEN`, `AUTH_KEY_NOT_FOUND`, `AUTH_KEY_REVOKED`, `AUTH_KEY_SUSPENDED`, `AUTH_TEST_KEY_SANDBOX_ONLY`'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: AUTH_MISSING
message: Missing Authorization header
hint: 'Include "Authorization: Bearer bwk_xxx" header'
docUrl: https://backworkhealth.com/docs/errors#auth-missing
retryable: false
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
'402':
description: 'Error: `BILLING_CREDITS_EXHAUSTED`, plan-gate denial'
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/ErrorResponse'
- $ref: '#/components/schemas/GateDenialResponse'
example:
success: false
error:
code: BILLING_CREDITS_EXHAUSTED
message: Your organization has no request credits left for this call
hint: details.requests_required is this call's cost and details.requests_available is the balance. Retry once the balance covers the call. An organization admin can manage the plan and usage in the Backwork dashboard at https://backworkhealth.com/api-usage
docUrl: https://backworkhealth.com/docs/errors#billing-credits-exhausted
retryable: false
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
'403':
description: 'Error: `AUTHZ_SCOPE_REQUIRED`, `AUTHZ_ORIGIN_NOT_ALLOWED`'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: AUTHZ_SCOPE_REQUIRED
message: Insufficient permissions for this operation
hint: details.required_scopes lists the scopes this operation accepts
docUrl: https://backworkhealth.com/docs/errors#authz-scope-required
retryable: false
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
'429':
description: 'Error: `RATE_LIMIT_EXCEEDED`'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: RATE_LIMIT_EXCEEDED
message: Rate limit exceeded
hint: Wait the number of seconds in the Retry-After header, then retry
docUrl: https://backworkhealth.com/docs/errors#rate-limit-exceeded
retryable: true
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
'500':
description: 'Error: `SERVER_INTERNAL_ERROR`'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: SERVER_INTERNAL_ERROR
message: Internal server error
hint: Contact support@backworkhealth.com with the request_id from this response
docUrl: https://backworkhealth.com/docs/errors#server-internal-error
retryable: false
meta:
request_id: req_abc123
timestamp: '2024-01-15T10:30:00Z'
servers:
- url: https://backworkhealth.com/api/v1
description: Production server
- url: http://localhost:3000/api/v1
description: Local development
components:
schemas:
JsonArray:
type: array
items:
$ref: '#/components/schemas/JsonValue'
ErrorResponse:
type: object
properties:
success:
type: boolean
const: false
error:
type: object
properties:
code:
$ref: '#/components/schemas/ApiErrorCode'
message:
type: string
description: Human-readable error message
hint:
description: Suggestion for resolving the error
type: string
docUrl:
description: Link to error documentation
type: string
format: uri
retryable:
type: boolean
description: Whether repeating the identical request later can succeed
details:
description: Additional error details
$ref: '#/components/schemas/JsonValue'
required:
- code
- message
- retryable
meta:
$ref: '#/components/schemas/ResponseMeta'
required:
- success
- error
- meta
CodeSpendingData:
type: object
properties:
total_paid:
type: string
description: Total paid, as a decimal string
examples:
- '1234567.89'
total_claims:
type: integer
reported_patient_count_sum:
type: integer
patient_count_semantics:
type: string
const: sum_of_source_row_counts_not_distinct_people
description: Patient counts are summed at publisher row grain and are not deduplicated people
unique_providers:
type: integer
date_range:
type: object
properties:
min:
type:
- string
- 'null'
max:
type:
- string
- 'null'
required:
- min
- max
by_year:
type: array
items:
type: object
properties:
year:
type: integer
total_paid:
type: string
total_claims:
type: integer
reported_patient_count_sum:
type: integer
required:
- year
- total_paid
- total_claims
- reported_patient_count_sum
required:
- total_paid
- total_claims
- reported_patient_count_sum
- patient_count_semantics
- unique_providers
- date_range
- by_year
ApiErrorCode:
type: string
enum:
- AUTH_MISSING
- AUTH_INVALID_FORMAT
- AUTH_INVALID_KEY_FORMAT
- AUTH_INVALID_TOKEN
- AUTH_KEY_NOT_FOUND
- AUTH_KEY_REVOKED
- AUTH_KEY_SUSPENDED
- AUTH_KEY_EXPIRED
- AUTH_SANDBOX_TEST_KEY_REQUIRED
- AUTH_TEST_KEY_SANDBOX_ONLY
- AUTHZ_SCOPE_REQUIRED
- AUTHZ_IP_NOT_ALLOWED
- AUTHZ_ORIGIN_NOT_ALLOWED
- BILLING_FEATURE_REQUIRED
- BILLING_CREDITS_EXHAUSTED
- RATE_LIMIT_EXCEEDED
- RATE_QUOTA_EXCEEDED
- RATE_CONCURRENT_EXCEEDED
- VALIDATION_ERROR
- VALIDATION_INVALID_JSON
- VALIDATION_REQUIRED_FIELD
- VALIDATION_OUT_OF_RANGE
- VALIDATION_INVALID_FORMAT
- PHI_NOT_ALLOWED
- RESOURCE_NOT_FOUND
- RESOURCE_POLICY_NOT_FOUND
- RESOURCE_CODE_NOT_FOUND
- RESOURCE_JURISDICTION_NOT_FOUND
- RESOURCE_PAYER_NOT_FOUND
- RESOURCE_RELEASE_NOT_AVAILABLE
- REQUEST_INVALID_CURSOR
- REQUEST_IDEMPOTENCY_CONFLICT
- REQUEST_IDEMPOTENCY_IN_PROGRESS
- REQUEST_UNSUPPORTED_CONTENT_TYPE
- REQUEST_FORMAT_NOT_ACCEPTABLE
- SERVER_INTERNAL_ERROR
- SERVER_DATABASE_ERROR
- SERVER_SEARCH_UNAVAILABLE
- SERVER_TIMEOUT
- SERVER_UNAVAILABLE
- SERVER_IDEMPOTENCY_UNAVAILABLE
- SERVER_UPSTREAM_UNAVAILABLE
- COMMERCIAL_SURFACE_UNAVAILABLE
description: Machine-readable error code
ResponseMeta:
type: object
properties:
request_id:
type: string
description: Unique request identifier for tracing
timestamp:
type: string
format: date-time
description: Response timestamp
required:
- request_id
- timestamp
GateDenialResponse:
type: object
properties:
success:
type: boolean
const: false
error:
type: object
properties:
code:
type: string
enum:
- INVALID_API_KEY
- SUBSCRIPTION_INACTIVE
- FEATURE_NOT_AVAILABLE
- USAGE_LIMIT_EXCEEDED
- DAILY_LIMIT_EXCEEDED
message:
type: string
description: Which limit or feature check failed, when it resets, and who can manage the plan
required:
- code
- message
meta:
$ref: '#/components/schemas/ResponseMeta'
required:
- success
- error
- meta
description: The plan does not include this feature or its usage is exhausted.
JsonObject:
type: object
propertyNames:
type: string
additionalProperties:
$ref: '#/components/schemas/JsonValue'
JsonValue:
anyOf:
- type: string
- type: number
- type: boolean
- type: 'null'
- $ref: '#/components/schemas/JsonArray'
- $ref: '#/components/schemas/JsonObject'
description: Any JSON value.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
description: 'API key in format: bwk_live_xxxxx. Keys issued before the rename (vrt_live_) remain valid. bwk_test_ keys work only on the sandbox.'
x-refined-from:
- backworkhealth-com-openapi.json
- backworkhealth-com-v1-openapi.json