
Martindale Data API: Extract Structured JSON in 2026
Martindale Data API: Extract Structured JSON in 2026 This guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeThis guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.
Run a live request from this page. No sign-up needed.
TL;DR
Use AlterLab's Extract API to get typed JSON from Martindale directory pages. Define a JSON schema for the fields you need (name, description, category, url, contact), POST the URL and schema, and receive validated data without HTML parsing. The approach works at scale with async batching and respects rate limits.
Why use Martindale data?
Martindale hosts a widely referenced legal directory. Engineers use its public listings for:
- Training NLP models on professional bios and specialties
- Building analytics dashboards for market segmentation
- Enriching CRM records with verified attorney contact details
These use cases rely on structured, machine‑readable data rather than raw HTML.
What data can you extract?
From a typical Martindale profile page you can pull:
- name – attorney or firm name
- description – bio snippet or practice overview
- category – legal specialty (e.g., "Intellectual Property")
- url – canonical profile link
- contact – phone number or email when publicly shown
All fields are optional; your schema determines which appear in the output.
The extraction approach
Raw HTTP requests followed by HTML parsing are fragile: Martindale updates its front‑end frequently, breaking CSS selectors and XPath paths. Maintaining parsers consumes engineering time and introduces latency.
A data API like AlterLab abstracts away the variability. You supply a schema and a target URL; the service handles retrieval, anti‑bot navigation, and LLM‑guided extraction, returning JSON that matches your definition. This shifts effort from brittle scraping to reliable data consumption.
Quick start with AlterLab Extract API
First, install the Python SDK (or use cURL directly). The AlterLab getting started guide shows installation steps: Getting started guide.
Python example
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_API_KEY")
schema = {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The attorney or firm name"
},
"description": {
"type": "string",
"description": "Short bio or practice description"
},
"category": {
"type": "string",
"description": "Legal practice area"
},
"url": {
"type": "string",
"description": "Canonical Martindale profile URL"
},
"contact": {
"type": "string",
"description": "Public phone or email address"
}
}
}
result = client.scrape(
url="https://martindale.com/example-attorney",
extraction_schema=schema,
)
print(result["filtered_content"])Lines 5‑12 define the schema and call the extract method. The SDK handles authentication and retries.
cURL example
curl -X POST https://api.alterlab.io/v1/extract \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://martindale.com/example-attorney",
"schema": {
"properties": {
"name": {"type": "string"},
"description": {"type": "string"},
"category": {"type": "string"}
}
}
}'The request returns a JSON object with the requested fields.
Batch/async example (Python)
from alterlab import AlterLab
import asyncio
client = AlterLab("YOUR_API_KEY")
async def extract_one(url):
schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"category": {"type": "string"},
"url": {"type": "string"}
}
}
return await client.scrape(url=url, extraction_schema=schema)
async def main():
urls = [
"https://martindale.com/attorney/a",
"https://martindale.com/attorney/b",
"https://martindale.com/attorney/c"
]
results = await asyncio.gather(*[extract_one(u) for u in urls])
for r in results:
print(r.data)
if __name__ == "__main__":
asyncio.run(main())This pattern scales to hundreds of pages while respecting concurrency limits.
Define your schema
The Extract API uses JSON Schema to validate output. Each property you declare must have a type; AlterLab attempts to fill it from the page. If a field cannot be found, the service returns null for that key, preserving the schema shape.
Example schema for a minimal directory entry:
{
"type": "object",
"properties": {
"name": {"type": "string"},
"category": {"type": "string"}
},
"required": ["name"]
}Setting "required" ensures the API will retry or flag missing critical data.
Handle pagination and scale
Martindale listings often span multiple pages with ?page=2 style parameters. For high‑volume runs:
- Generate a list of target URLs (search results or sitemap).
- Use asyncio or a worker pool to call the Extract API in parallel.
- Monitor the
X-RateLimit-Remainingheader; AlterLab’s pricing page details tiers: AlterLab pricing. - Store results in a staging table, deduplicate by
url, and apply schema validation again before downstream consumption.
Cost remains predictable: each extraction is billed individually, with a floor of $0.001 and a ceiling of $0.50. There are no hidden fees or minimums.
Key takeaways
- Define a clear JSON schema for the Martindale fields you need.
- Let AlterLab’s Extract API handle retrieval, anti‑bot navigation, and LLM‑guided parsing.
- Receive typed JSON that requires no post‑processing HTML cleanup.
- Scale with async calls, respect rate limits, and pay only for successful extractions.
- Always verify that your target pages are publicly accessible and compliant with robots.txt and ToS.
By treating Martindale as a data source accessed through a purpose‑built API, you reduce maintenance overhead and gain reliable, structured output for analytics, model training, or enrichment pipelines.
Hit reply if you have questions.
Was this article helpful?
Frequently Asked Questions
Related Articles

Oxylabs Alternative: Practical Developer Guide for Web Scraping Pipelines
Build reliable scraping pipelines with anti-bot handling, auto-escalation, and monitoring using a practical AltLab-compatible solution. Follow the 3-step setup, integrate with your existing workflow, and control costs at $0.0002 per request.
Herald Blog Service

Python aiohttp vs. httpx for High-Throughput Web Scraping
A benchmark‑driven comparison of aiohttp and httpx for asynchronous scraping, with concrete numbers, code snippets, and guidance on when to choose each library.
Herald Blog Service

MCP Servers Explained: How AI Tools Access the Real-Time Web in 2026
Learn how Model Context Protocol servers enable AI agents to fetch live data via scraping APIs, with architecture, code examples, and best practices for 2026.
Herald Blog Service
Popular Posts
Recommended

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Ethical Web Scraping: Robots.txt, Rate Limits, and ToS

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

How to Scrape E-Commerce Sites for AI Agents Using Playwright and LLMs
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Ethical Web Scraping: Robots.txt, Rate Limits, and ToS

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

How to Scrape E-Commerce Sites for AI Agents Using Playwright and LLMs
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.