Screenleap Python API Docs | dltHub
Build a Screenleap-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.
Last updated:
Screenleap is a screen‑sharing platform that provides a REST API to create, manage and record screen‑share sessions. The REST API base URL is https://api.screenleap.com/v2 and Requests require an accountId and an authtoken; the authtoken must be sent over HTTPS..
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 Screenleap data in under 10 minutes.
What data can I load from Screenleap?
Here are some of the endpoints you can load from Screenleap:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| screen_shares | /screen-shares | GET | Retrieve share sessions matching filters (startedBefore/After, endedBefore/After, externalId, dateFormat). Returns a JSON array of share session objects. | |
| recent_screen_shares | /recent-screen-shares | GET | Retrieve recent share sessions (waiting, active, or ended within last 5 minutes). Returns a JSON array. | |
| screen_share | /screen-shares/{screenShareCode} | GET | Retrieve information about a specific share session (sessionId, dateCreated, participants, etc.). | |
| recordings_webhook | (callbacks) RECORDING_COMPLETE payload | POST | Server‑to‑server callback sent when a recording is processed; payload includes recordingId and recordingVideoUrl. | |
| recordings_info | (recording download URL provided in webhook) | GET | Download processed MP4 file from the recordingVideoUrl; encrypted recordings require S3 SSE‑C headers. | |
| screen_shares_stop | /screen-shares/{screenShareCode}/stop | POST | Programmatically stop an active share session. |
How do I authenticate with the Screenleap API?
All API requests must include your accountId (header or query parameter) and an authtoken sent as a request header. Calls that require an authtoken must be made over HTTPS.
1. Get your credentials
- Sign up for a developer account at Screenleap and open the Developer / API section.
- Note your accountId shown in the developer dashboard.
- Generate or copy the authtoken (API token) from the Developer/API credentials section.
- Store accountId and authtoken securely and use authtoken in request headers; include accountId as header or query param when required.
2. Add them to .dlt/secrets.toml
[sources.screenleap_source] accountid = "your_account_id_here" authtoken = "your_authtoken_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 Screenleap 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 screenleap_pipeline.py
If everything is configured correctly, you'll see output like this:
Pipeline screenleap_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset screenleap_data The duckdb destination used duckdb:/screenleap.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs
Inspect your pipeline and data:
dlt pipeline screenleap_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 screen_shares and recent_screen_shares from the Screenleap 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 screenleap_source(authtoken=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.screenleap.com/v2", "auth": { "type": "api_key", "authtoken": authtoken, }, }, "resources": [ {"name": "screen_shares", "endpoint": {"path": "screen-shares"}}, {"name": "recent_screen_shares", "endpoint": {"path": "recent-screen-shares"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="screenleap_pipeline", destination="duckdb", dataset_name="screenleap_data", ) load_info = pipeline.run(screenleap_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("screenleap_pipeline").dataset() sessions_df = data.screen_shares.df() print(sessions_df.head())
SQL (DuckDB example):
SELECT * FROM screenleap_data.screen_shares LIMIT 10;
In a marimo or Jupyter notebook:
import dlt data = dlt.pipeline("screenleap_pipeline").dataset() data.screen_shares.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 Screenleap 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 401 Unauthorized, verify that the authtoken header is present and correct and that the request uses HTTPS for calls requiring authtoken. Ensure accountid is included as a header or query parameter when required.
Forbidden / Wrong share session
403 responses occur when attempting to access or stop a share session not created by your account. Confirm the screenShareCode and that the share session was created under your accountId.
Not found
404 responses indicate the specified share code or resource does not exist or has already ended.
Bad request and error messages
400‑series responses include a JSON errorMessage field with details about malformed requests or invalid parameters. Validate query parameters (date formats, timestamps) and required path segments.
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 Screenleap?
Request dlt skills, commands, AGENT.md files, and AI-native context.