
Martindale Data API: Extract Structured JSON in 2026
Learn how to extract structured Martindale data via AlterLab's data API, get typed JSON output for name, description, category, and more with minimal code.
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.
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
import alterlab
client = alterlab.Client("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.extract(
url="https://martindale.com/example-attorney",
schema=schema,
)
print(result.data)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)
import alterlab
import asyncio
client = alterlab.Client("YOUR_API_KEY")
async def extract_one(url):
schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"category": {"type": "string"},
"url": {"type": "string"}
}
}
return await client.extract_async(url=url, 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

Rotating Proxies vs. Residential Proxies: Choosing the Right Solution for Your Scraper
Learn the differences between rotating and residential proxies, when each excels, and how to configure them in your scraping pipeline for reliable, ethical data collection.
Herald Blog Service

Choosing a Web Scraping API in 2026: Pricing, Anti-Bot Tiers, and Reliability
Compare pricing models, anti-bot handling, and reliability factors when selecting a web scraping API for scalable data pipelines.
Herald Blog Service

Apify Alternative: Simple Web Scraping Without Actor Marketplace Complexity
Learn how to replace Apify's actor-based workflow with a straightforward scraping API that handles proxies, browsers, and anti-bot measures automatically.
Herald Blog Service
Popular Posts
Recommended
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

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

AlterLab vs Firecrawl: Which Scraping API Is Better in 2026?

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
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.