Sigrid Says Python API Docs | dltHub
Build a Sigrid Says-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.
Last updated:
Sigrid Says is a platform that analyzes codebases and provides maintainability, security, reliability, architecture and open-source health analysis and findings via a REST API. The REST API base URL is https://sigrid-says.com/rest/analysis-results/api/v1 and all requests require a Bearer token for authentication.
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 Sigrid Says data in under 10 minutes.
What data can I load from Sigrid Says?
Here are some of the endpoints you can load from Sigrid Says:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| maintainability_portfolio | maintainability/{customer} | GET | portfolio-level maintainability ratings (array of systems) | |
| maintainability_system_raw | maintainability/{customer}/{system}/raw | GET | full maintainability analysis JSON for a system | |
| refactoring_candidates | refactoring-candidates/{customer}/{system}/{systemProperty} | GET | refactoring candidates for a systemProperty (e.g. unitSize, duplication) | |
| security_findings | security-findings/{customer}/{system} | GET | open security findings for a system (optionally ?model=... or ?sarif=true) | |
| reliability_findings | reliability-findings/{customer}/{system} | GET | open reliability findings for a system (optionally ?model=...) | |
| model_ratings_portfolio | model-ratings/{customer} | GET | portfolio-level model ratings (use ?feature=SECURITY etc.) | |
| model_ratings_system | model-ratings/{customer}/{system} | GET | system-level model ratings | |
| osh_findings_portfolio | osh-findings/{customer} | GET | Open Source Health SBOM array (CycloneDX based) per system | |
| osh_findings_system | osh-findings/{customer}/{system} | GET | Open Source Health SBOM for a single system | |
| architecture_quality_portfolio | architecture-quality/{customer} | GET | architecture quality ratings for portfolio | |
| architecture_quality_system_raw | architecture-quality/{customer}/{system}/raw | GET | full architecture quality analysis JSON for a system | |
| system_metadata_system | system-metadata/{customer}/{system} | GET | metadata for a single system | |
| system_metadata_portfolio | system-metadata/{customer} | GET | metadata for all systems in a customer | |
| licenses | licenses/{customer} | GET | licenses | list of licenses for a customer (response contains "licenses" array) |
| user_management_users | /rest/auth/api/user-management/{customer}/users | GET | list users in portfolio (user objects array) |
How do I authenticate with the Sigrid Says API?
Authentication uses Sigrid CI / Sigrid API tokens. Pass the token in the Authorization header as: Authorization: Bearer {SIGRID_CI_TOKEN}. Requests return 401 for invalid/unauthorized tokens.
1. Get your credentials
- Sign in to your Sigrid account (web UI).
- Go to Organization / Integration or Authentication Tokens page.
- Create a new token with required scopes (Sigrid CI / API access).
- Copy the token and store it securely; use it as the Bearer token in Authorization header.
2. Add them to .dlt/secrets.toml
[sources.sigrid_says_source] # put inside [sources.sigrid_source] token = "your_sigrid_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 Sigrid Says 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 sigrid_says_pipeline.py
If everything is configured correctly, you'll see output like this:
Pipeline sigrid_says_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset sigrid_says_data The duckdb destination used duckdb:/sigrid_says.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs
Inspect your pipeline and data:
dlt pipeline sigrid_says_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 model-ratings and maintainability from the Sigrid Says 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 sigrid_says_source(token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://sigrid-says.com/rest/analysis-results/api/v1", "auth": { "type": "bearer", "token": token, }, }, "resources": [ {"name": "model_ratings", "endpoint": {"path": "model-ratings/{customer}"}}, {"name": "maintainability", "endpoint": {"path": "maintainability/{customer}"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="sigrid_says_pipeline", destination="duckdb", dataset_name="sigrid_says_data", ) load_info = pipeline.run(sigrid_says_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("sigrid_says_pipeline").dataset() sessions_df = data.maintainability.df() print(sessions_df.head())
SQL (DuckDB example):
SELECT * FROM sigrid_says_data.maintainability LIMIT 10;
In a marimo or Jupyter notebook:
import dlt data = dlt.pipeline("sigrid_says_pipeline").dataset() data.maintainability.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 Sigrid Says data to?
dlt supports loading into any of these destinations — only the destination parameter changes:
| Destination | Example 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.
Troubleshooting
Authentication failures
If you receive HTTP 401, verify the Authorization header uses the exact token and the format: Authorization: Bearer {SIGRID_CI_TOKEN}. Ensure token has access to the requested customer and system.
Rate limiting
Sigrid enforces rate limits: 2500 requests per 5 minutes per source IP. Excess triggers HTTP 429. Also analysis requests have a separate token-based limiter (15 tokens per system, replenished once per 5 minutes); analysis requests when tokens exhausted return HTTP 429.
Pagination and data selectors
Most portfolio-level endpoints return arrays at the top level (no wrapping key). Some endpoints return specific keys (e.g. licenses returns { "licenses": [ ... ] }). For SBOM/OSH endpoints responses follow CycloneDX format — treat them as objects or arrays per documentation.
Common API errors: HTTP 401 (unauthorized/invalid token), HTTP 403 (forbidden / insufficient permissions), HTTP 404 (customer or system not found), HTTP 429 (rate limited), HTTP 500 (server error).
Ensure that the API key is valid to avoid 401 Unauthorized errors. Also, verify endpoint paths and parameters to avoid 404 Not Found errors.
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 Sigrid Says?
Request dlt skills, commands, AGENT.md files, and AI-native context.