```yaml
product: AlterLab
title: Martindale Data API: Extract Structured JSON in 2026
category: Tutorials
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
last_updated: 2026-08-06
canonical_facts:
  - "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."
source_url: https://alterlab.io/blog/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 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](/docs/quickstart/installation).

### Python example
```python title="extract_martindale-com.py" {5-12}
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
```bash title="Terminal"
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)
```python title="batch_martindale.py" {8-15}
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:
```json
{
  "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:
1. Generate a list of target URLs (search results or sitemap).
2. Use asyncio or a worker pool to call the Extract API in parallel.
3. Monitor the `X-RateLimit-Remaining` header; AlterLab’s pricing page details tiers: [AlterLab pricing](/pricing).
4. 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.

## Frequently Asked Questions

### Is there an official Martindale data API?

Martindale does not provide a public API for its directory data. AlterLab fills that gap by enabling structured JSON extraction from publicly accessible pages, handling anti-bot measures and delivering typed output.

### What Martindale data can I extract with AlterLab?

You can extract publicly listed directory fields such as name, description, practice category, profile URL, and contact information. The output conforms to a JSON schema you define, ensuring type safety and consistency.

### How much does Martindale data extraction cost?

AlterLab charges per extraction based on complexity, with a minimum of $0.001 and a maximum of $0.50 per call. There are no minimums, no expiring balances, and you pay only for what you use.

## Related

- [How to Scrape Crozdesk Data: Complete Guide for 2026](<https://alterlab.io/blog/how-to-scrape-crozdesk-data-complete-guide-for-2026>)
- [How to Scrape SoftwareSuggest Data: Complete Guide for 2026](<https://alterlab.io/blog/how-to-scrape-softwaresuggest-data-complete-guide-for-2026>)
- [How to Scrape SaaSworthy Data: Complete Guide for 2026](<https://alterlab.io/blog/how-to-scrape-saasworthy-data-complete-guide-for-2026>)