Avvo Python API Docs | dltHub

Build a Avvo-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.

Last updated:

Avvo's REST API uses JWT for authentication; access token is obtained via https://api.avvo.com/api/5/jwt_access/lawyer_token/. Lawyer details can be retrieved using https://api.avvo.com/api/4/lawyers/:id.json. Review comments can be created and updated via specific endpoints. The REST API base URL is https://api.avvo.com/api/4 and All requests require OAuth2 Bearer tokens; some endpoints accept a lawyer-scoped JWT obtained via a protected JWT endpoint..

dlt is an open-source Python library that handles authentication, pagination, and schema evolution automatically. dlthub provides AI context files that enable code assistants to generate production-ready pipelines. Install with uv pip install "dlt[workspace]" and start loading Avvo data in under 10 minutes.


What data can I load from Avvo?

Here are some of the endpoints you can load from Avvo:

ResourceEndpointMethodData selectorDescription
lawyershttps://api.avvo.com/api/4/lawyers.jsonGETlawyersIndex: bulk lookup of lawyers (supports id[] param)
lawyers_showhttps://api.avvo.com/api/4/lawyers/:id.jsonGETlawyersShow: single lawyer by id
lawyers_searchhttps://api.avvo.com/api/4/lawyers/search.jsonGETlawyersSearch lawyers by q, loc, lat,long, radius, filters
lawyer_addresseshttps://api.avvo.com/api/4/lawyer_addresses.jsonGETlawyer_addressesAddresses for lawyer(s) (params: lawyer_id / lawyer_ids)
specialtieshttps://api.avvo.com/api/4/specialties.jsonGETspecialtiesList or bulk specialties
specialties_showhttps://api.avvo.com/api/4/specialties/:id.jsonGETspecialtiesSingle specialty
specialties_searchhttps://api.avvo.com/api/4/specialties/search.jsonGETspecialtiesSearch specialties by q
reviewshttps://api.avvo.com/api/4/reviews.jsonGETreviewsReviews for lawyers (lawyer_id param)
reviews_jwt_indexhttps://api.avvo.com/api/5/reviewsGETreviewsJWT-scoped reviews index (requires JWT bearer)
reviews_jwt_showhttps://api.avvo.com/api/5/reviews/:review_idGETreviewsJWT-scoped single review
jwt_generatorhttps://api.avvo.com/api/5/jwt_access/lawyer_token/:lawyer_idGETjwt (response contains key 'jwt')Obtain lawyer-scoped JWT (requires OAuth bearer)

How do I authenticate with the Avvo API?

The API supports OAuth2: obtain client_id and client_secret by creating an app at https://www.avvo.com/oauth2/apps, authorize via POST to https://api.avvo.com/api/2/oauth2/authorize to get an access_token returned in the redirect (response_type=code_and_token). Include the OAuth access token in requests using the Authorization: Bearer header. For lawyer-scoped actions, call the JWT generator GET https://api.avvo.com/api/5/jwt_access/lawyer_token/:lawyer_id with an OAuth bearer token to receive a short-lived JWT; protected /api/5 endpoints require Authorization: Bearer .

1. Get your credentials

  1. Login to Avvo.com and visit https://www.avvo.com/oauth2/apps. 2. Create a new app; note the client_id and client_secret shown on app creation. 3. Use POST https://api.avvo.com/api/2/oauth2/authorize with client_id, client_secret, redirect_uri, and response_type=code_and_token to generate an authorization URL. 4. Complete the flow and capture the access_token from the redirect URL. 5. For lawyer-scoped JWTs, call GET https://api.avvo.com/api/5/jwt_access/lawyer_token/:lawyer_id with Authorization: Bearer <oauth_token> to get a JWT (valid ~20 minutes).

2. Add them to .dlt/secrets.toml

[sources.avvo_source] client_id = "your_client_id_here" client_secret = "your_client_secret_here" oauth_token = "your_oauth_access_token_here"

dlt reads this automatically at runtime — never hardcode tokens in your pipeline script. For production environments, see setting up credentials with dlt for environment variable and vault-based options.


How do I set up and run the pipeline?

Set up a virtual environment and install dlt:

uv venv && source .venv/bin/activate uv pip install "dlt[workspace]"

1. Install the dlt AI Workbench:

dlt ai init --agent <your-agent> # <agent>: claude | cursor | codex

This installs project rules, a secrets management skill, appropriate ignore files, and configures the dlt MCP server for your agent. Learn more →

2. Install the rest-api-pipeline toolkit:

dlt ai toolkit rest-api-pipeline install

This loads the skills and context about dlt the agent uses to build the pipeline iteratively, efficiently, and safely. The agent uses MCP tools to inspect credentials — it never needs to read your secrets.toml directly. Learn more →

3. Start LLM-assisted coding:

Use /find-source to load data from the Avvo API into DuckDB.

The rest-api-pipeline toolkit takes over from here — it reads relevant API documentation, presents you with options for which endpoints to load, and follows a structured workflow to scaffold, debug, and validate the pipeline step by step.

4. Run the pipeline:

python avvo_pipeline.py

If everything is configured correctly, you'll see output like this:

Pipeline avvo_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset avvo_data The duckdb destination used duckdb:/avvo.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs

Inspect your pipeline and data:

dlt pipeline avvo_pipeline show

This opens the Pipeline Dashboard where you can verify pipeline state, load metrics, schema (tables, columns, types), and query the loaded data directly.


Python pipeline example

This example loads lawyers and reviews from the Avvo API into DuckDB. It mirrors the endpoint and data selector configuration from the table above:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def avvo_source(oauth_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.avvo.com/api/4", "auth": { "type": "bearer", "token": oauth_token, }, }, "resources": [ {"name": "lawyers", "endpoint": {"path": "api/4/lawyers.json", "data_selector": "lawyers"}}, {"name": "reviews", "endpoint": {"path": "api/4/reviews.json", "data_selector": "reviews"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="avvo_pipeline", destination="duckdb", dataset_name="avvo_data", ) load_info = pipeline.run(avvo_source()) print(load_info)

To add more endpoints, append entries from the resource table to the "resources" list using the same name, path, and data_selector pattern.


How do I query the loaded data?

Once the pipeline runs, dlt creates one table per resource. You can query with Python or SQL.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("avvo_pipeline").dataset() sessions_df = data.lawyers.df() print(sessions_df.head())

SQL (DuckDB example):

SELECT * FROM avvo_data.lawyers LIMIT 10;

In a marimo or Jupyter notebook:

import dlt data = dlt.pipeline("avvo_pipeline").dataset() data.lawyers.df().head()

See how to explore your data in marimo Notebooks and how to query your data in Python with dataset.


What destinations can I load Avvo data to?

dlt supports loading into any of these destinations — only the destination parameter changes:

DestinationExample value
DuckDB (local, default)"duckdb"
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Change the destination in dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. See the full destinations list.


Next steps

Continue your data engineering journey with the other toolkits of the dltHub AI Workbench:

  • data-exploration — Build custom notebooks, charts, and dashboards for deeper analysis with marimo notebooks.
  • dlthub-runtime — Deploy, schedule, and monitor your pipeline in production.
dlt ai toolkit data-exploration install dlt ai toolkit dlthub-runtime install

Was this page helpful?

Community Hub

Need more dlt context for Avvo?

Request dlt skills, commands, AGENT.md files, and AI-native context.