# Houston Restaurant Health Inspections (`keeganlabs/houston-restaurant-health-inspections`) Actor

Houston (TX) restaurant & food-establishment health inspection records — scores, pass/fail results, risk profiles, and itemized violations — from the City of Houston open-data portal's documented CKAN API. ~201k inspections (FY2011–FY2015) + ~84k violation rows (FY2012–FY2014).

- **URL**: https://apify.com/keeganlabs/houston-restaurant-health-inspections.md
- **Developed by:** [Keegan Labs](https://apify.com/keeganlabs) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 inspection records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Houston Restaurant Health Inspections

Get **Houston (TX) restaurant and food-establishment health inspection records** as clean,
structured JSON — establishment name and address, inspection date and type, numeric score,
PASS/FAIL result, facility risk profile, and (in violations mode) the full itemized list of
violations written up by the inspector, straight from the **City of Houston's official
open-data portal** ([data.houstontx.gov](https://data.houstontx.gov)).

No HTML scraping, no proxies, no brittle selectors: this actor reads the city's documented
CKAN datastore API, pages through it politely, and normalizes every record into one
consistent schema.

### What data you get

Two official Houston Health and Human Services (Consumer Health Division) datasets:

| Mode | Coverage | Volume | What's in a record |
| --- | --- | --- | --- |
| `inspections` (default) | FY2011 – FY2015 (Jul 2010 – Mar 2015) | ~201,000 inspections | Facility name/type/address/ZIP, inspection date & type, score, PASS/FAIL, risk profile, permits, follow-up date, citation number |
| `violations` | FY2012 – FY2014 | ~84,000 violation rows, grouped into one record per inspection | Everything above plus an itemized `violations[]` array: city ordinance code, demerit weight, the inspector's written comments, correct-by date |

**Freshness disclosure (read this):** Houston's machine-readable inspection publication
covers fiscal years 2011–2015 — this is the complete official archive the city exposes via
API, and the city has not published newer machine-readable inspection data (its old
consumer lookup site now redirects to the software vendor's homepage). That makes this
dataset the **only structured, bulk-accessible record of Houston restaurant inspections in
existence**. It is ideal for historical analysis, research, and enrichment — not for
checking last week's inspection. Coverage was re-verified against the live API on
2026-07-22 (~201,255 inspection records reachable).

### Example output record

```json
{
    "source": "data.houstontx.gov",
    "dataset": "food-service-facility-inspections",
    "fiscalYear": "FY2011",
    "inspectionId": "1269554",
    "accountNumber": "413443",
    "establishmentName": "TAQUERIA JALISCO MEX - Texas",
    "establishmentType": "Mobile - Conventional, Unrestricted, Motorized",
    "cuisine": null,
    "address": {
        "street": "2322 1/2 WIRT RD",
        "suite": null,
        "city": "HOUSTON",
        "state": "TX",
        "zip": "77055"
    },
    "inspectionDate": "2010-12-04",
    "inspectionType": "Routine Inspection (001)",
    "score": 3,
    "result": "PASS",
    "followUpDate": "2011-03-05",
    "citationNumber": null,
    "riskProfile": "HIGH",
    "riskScore": 6,
    "numberOfEmployees": 2,
    "permits": "H",
    "facilityStatus": "Active",
    "violations": []
}
````

In `violations` mode, `violations[]` is populated, e.g.:

```json
"violations": [
    {
        "code": "20-21.21(a)",
        "weight": 3,
        "description": "Effective measures intended to minimize the presence of cockroaches on the premises not utilized. (correct immediately)",
        "correctByDate": "2011-10-18"
    }
]
```

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | select | `inspections` | `inspections` or `violations` (itemized violations, FY2012–FY2014) |
| `establishmentName` | string | — | Case-insensitive substring match on facility name (`"taqueria"`, `"whataburger"`) |
| `zipCode` | string | — | Exact 5-digit ZIP filter (`"77036"`) |
| `dateFrom` / `dateTo` | string | — | Inspection date range, `YYYY-MM-DD` |
| `maxRecords` | integer | 500 | Cap on records pushed (each record = one billable event) |

### Use cases

- **Due diligence & risk scoring** — pull a location's full inspection and violation
  history before a lease, acquisition, or franchise deal in the Houston market.
- **Food-safety journalism & research** — 200k+ inspections with inspector-written
  violation narratives (roach findings, condemned food, temperature abuse) is rich raw
  material for investigative and academic work on enforcement patterns by ZIP and risk tier.
- **Local consumer apps & enrichment** — join by name/address/ZIP to add a health-history
  signal to restaurant directories, POI databases, or real-estate datasets.
- **ML training data** — labeled (score, PASS/FAIL) records paired with free-text violation
  descriptions.

### Pricing

Pay-per-event — you pay only for what you actually get, no subscription:

- **$0.005 per actor start**
- **$0.0008 per record** ($0.80 per 1,000 records)

Priced against the comparable city actors on Apify Store: the NYC restaurant-inspection
actors ([opaldata/nyc-restaurant-inspections](https://apify.com/opaldata/nyc-restaurant-inspections),
[copious\_atoll/nyc-restaurant-inspections](https://apify.com/copious_atoll/nyc-restaurant-inspections))
charge **$1.00 per 1,000 records** on the same pay-per-result model. Houston is priced 20%
below those comps because its official archive is historical (FY2011–FY2015) rather than
continuously refreshed. The full ~201k-record archive costs about $161 — assembled by hand
from the city's five fiscal-year extracts, that's weeks of work.

### How it works (politeness & reliability)

- Uses the city's **documented JSON API** (`/api/3/action/datastore_search`), never HTML.
- Descriptive User-Agent, sequential paging with delays, exponential backoff on 429/5xx.
- Server-side full-text narrowing plus authoritative client-side filtering, so ZIP+4
  quirks in the source data never drop matching records.
- Fiscal-year resources outside your requested date range are skipped entirely.

# Actor input Schema

## `mode` (type: `string`):

"inspections" returns one record per inspection (FY2011–FY2015, richest facility metadata, no itemized violations). "violations" returns one record per inspection with an itemized violations array (FY2012–FY2014 coverage).

## `establishmentName` (type: `string`):

Case-insensitive substring match on the facility name, e.g. "taqueria" or "whataburger". Leave empty for all establishments.

## `zipCode` (type: `string`):

Exact 5-digit Houston ZIP code filter, e.g. "77036". Leave empty for all ZIP codes.

## `dateFrom` (type: `string`):

Earliest inspection date to include, formatted YYYY-MM-DD. Data coverage starts 2010-07-01.

## `dateTo` (type: `string`):

Latest inspection date to include, formatted YYYY-MM-DD. Data coverage ends 2015-03-31.

## `maxRecords` (type: `integer`):

Maximum number of records to push to the dataset (each pushed record is one billable event).

## Actor input object example

```json
{
  "mode": "inspections",
  "establishmentName": "taqueria",
  "maxRecords": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "establishmentName": "taqueria",
    "maxRecords": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("keeganlabs/houston-restaurant-health-inspections").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "establishmentName": "taqueria",
    "maxRecords": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("keeganlabs/houston-restaurant-health-inspections").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "establishmentName": "taqueria",
  "maxRecords": 100
}' |
apify call keeganlabs/houston-restaurant-health-inspections --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=keeganlabs/houston-restaurant-health-inspections",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Houston Restaurant Health Inspections",
        "description": "Houston (TX) restaurant & food-establishment health inspection records — scores, pass/fail results, risk profiles, and itemized violations — from the City of Houston open-data portal's documented CKAN API. ~201k inspections (FY2011–FY2015) + ~84k violation rows (FY2012–FY2014).",
        "version": "1.0",
        "x-build-id": "9BAzkVHDy0Hp27K7o"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/keeganlabs~houston-restaurant-health-inspections/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-keeganlabs-houston-restaurant-health-inspections",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/keeganlabs~houston-restaurant-health-inspections/runs": {
            "post": {
                "operationId": "runs-sync-keeganlabs-houston-restaurant-health-inspections",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/keeganlabs~houston-restaurant-health-inspections/run-sync": {
            "post": {
                "operationId": "run-sync-keeganlabs-houston-restaurant-health-inspections",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Dataset mode",
                        "enum": [
                            "inspections",
                            "violations"
                        ],
                        "type": "string",
                        "description": "\"inspections\" returns one record per inspection (FY2011–FY2015, richest facility metadata, no itemized violations). \"violations\" returns one record per inspection with an itemized violations array (FY2012–FY2014 coverage).",
                        "default": "inspections"
                    },
                    "establishmentName": {
                        "title": "Establishment name contains",
                        "type": "string",
                        "description": "Case-insensitive substring match on the facility name, e.g. \"taqueria\" or \"whataburger\". Leave empty for all establishments."
                    },
                    "zipCode": {
                        "title": "ZIP code",
                        "pattern": "^[0-9]{5}$",
                        "type": "string",
                        "description": "Exact 5-digit Houston ZIP code filter, e.g. \"77036\". Leave empty for all ZIP codes."
                    },
                    "dateFrom": {
                        "title": "Inspection date from",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Earliest inspection date to include, formatted YYYY-MM-DD. Data coverage starts 2010-07-01."
                    },
                    "dateTo": {
                        "title": "Inspection date to",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Latest inspection date to include, formatted YYYY-MM-DD. Data coverage ends 2015-03-31."
                    },
                    "maxRecords": {
                        "title": "Max records",
                        "minimum": 1,
                        "maximum": 250000,
                        "type": "integer",
                        "description": "Maximum number of records to push to the dataset (each pushed record is one billable event).",
                        "default": 500
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
