statutes.capitol.texas.gov APIstatutes.capitol.texas.gov ↗
Access Texas Constitution and statute text via API. Search full-text, list codes, chapters, and sections, or retrieve exact statute text by code and section number.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/25b4b583-9866-4ec3-a032-db0eb1266edb/list_codes' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace statutes-capitol-texas-gov-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Texas Statutes SDK — browse codes, search, and read statute text."""
from parse_apis.Texas_Statutes_API import TexasStatutes, CodeNotFound
client = TexasStatutes()
# List all available statute codes
for code in client.codes.list(limit=5):
print(code.code, code.name)
# Navigate into the Penal Code's chapters via constructible Code
penal = client.code("PE")
chapter = penal.chapters.list(limit=1).first()
if chapter:
print(f"First chapter: {chapter.title} (key: {chapter.url_key})")
# Drill into sections of that chapter
for sec in chapter.sections.list(limit=3):
print(f" {sec.section_number}: {sec.title}")
# Full-text search across all codes
response = client.search_responses.search(query="freedom of speech")
print(f"Found {response.total_results} results for '{response.query}'")
for r in response.results:
print(f" [{r.document_code}] {r.title}")
# Get the actual text of a specific section
try:
text = client.section_texts.get(code="CN", chapter="CN.1", section="1.8")
print(f"\n{text.chapter_title} — Section {text.section}")
print(text.text[:200])
except CodeNotFound as exc:
print(f"Not found: {exc}")
print("exercised: codes.list / chapters.list / sections.list / search_responses.search / section_texts.get")
Lists all available Texas statute codes (e.g. Penal Code, Family Code, The Texas Constitution). Each code has a short abbreviation used as the identifier in other endpoints. Returns the complete set of codes available in the system.
No input parameters required.
{
"type": "object",
"fields": {
"codes": "array of code objects with code, code_id, and name",
"total_codes": "integer"
},
"sample": {
"data": {
"codes": [
{
"code": "CN",
"name": "The Texas Constitution",
"code_id": "5"
},
{
"code": "PE",
"name": "Penal Code",
"code_id": "24"
}
],
"total_codes": 31
},
"status": "success"
}
}About the statutes.capitol.texas.gov API
This API exposes 5 endpoints covering the full Texas Constitution and Statutes hosted at statutes.capitol.texas.gov — including full-text search, hierarchical navigation, and section-level text retrieval. The get_section_text endpoint returns the complete text of any statute section or chapter given a two-letter code and chapter identifier. Results include structured fields like text, chapter_title, code, and section, making it straightforward to build legal-research or compliance tools on top of Texas law.
Code and Chapter Navigation
The list_codes endpoint returns the complete set of available Texas statute codes — each with a code abbreviation (e.g. PE for Penal Code, CN for the Texas Constitution, FA for Family Code), a code_id, and a human-readable name. That two-letter code is the key input for all other endpoints. list_chapters takes a code and returns every chapter or constitutional article within it, including a value field (format: hid.ahid, e.g. 61952.53300) needed by list_sections and a url_key (format: CODE.NUMBER, e.g. PE.1) needed by get_section_text.
Section Enumeration and Text Retrieval
Once you have a chapter, list_sections returns every section within it — each with a title, value, and section_number. Feed that section_number into get_section_text alongside the url_key-format chapter parameter to retrieve the exact statute text. If you omit the section parameter, get_section_text returns the full chapter text. The response includes the text string, chapter_title, code, and section (or null when the full chapter is returned).
Full-Text Search
The search_statutes endpoint accepts a required query string and an optional code filter (use a two-letter code to narrow results to a single statute, or omit — or pass ZZ — to search all codes). Results are paginated at up to 10 per page via the page parameter. Each result object includes a title, document_code, and doc_viewer_url pointing to the source document, alongside total_results and the echo of code, page, and query.
Coverage Scope
The API covers all codes listed on statutes.capitol.texas.gov, including both codified statutes and the Texas Constitution. Navigation follows the official hierarchy: code → chapter/article → section. Content reflects what the official site publishes; historical versions and session-law archives outside that hierarchy are not exposed through these endpoints.
The statutes.capitol.texas.gov API is a managed, monitored endpoint for statutes.capitol.texas.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when statutes.capitol.texas.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official statutes.capitol.texas.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a Texas legal research tool that lets users search statutes by keyword and drill into specific sections
- Automate compliance checks by programmatically retrieving sections of the Texas Business & Commerce Code
- Populate a legal-reference database with all chapters and sections across every Texas statute code
- Cross-reference Family Code sections in a family-law practice management application
- Generate plain-language summaries of specific statute sections by feeding
textoutput to an LLM - Monitor changes to specific Penal Code sections by periodically fetching section text and diffing results
- Build a Texas Constitution reference app navigating articles and sections via
list_chaptersandget_section_text
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does statutes.capitol.texas.gov have an official developer API?+
How does the search endpoint handle scope — can I search within a single code?+
search_statutes accepts an optional code parameter. Pass a two-letter code (e.g. PE for Penal Code, FA for Family Code) to restrict results to that code. Omitting code or passing ZZ searches across all available codes. Results are paginated at 10 per page using the page parameter, and the response includes total_results so you can calculate the full page count.What is the difference between the `chapter_value` and `url_key` fields from `list_chapters`?+
chapter_value is a numeric dotted identifier (e.g. 61952.53300) used as the chapter_value input to list_sections. url_key is a human-readable string in CODE.NUMBER format (e.g. PE.1) used as the chapter input to get_section_text. They reference the same chapter but serve different endpoints.Does the API expose historical or session-law versions of statutes?+
Are annotations, case citations, or attorney general opinions returned with section text?+
get_section_text endpoint returns the text of the statute itself along with chapter_title, code, and section — it does not include judicial annotations, case law citations, or AG opinion cross-references. You can fork this API on Parse and revise it to add an endpoint that retrieves annotated content if a suitable source is available.