LangSmith Fetch - Minimal CLI for fetching LangSmith threads and traces
Maintained. Last release 12 months ago.
pip install langsmith-fetchLangSmith Fetch
LangSmith Fetch is CLI for fetching threads or traces from LangSmith projects. It is designed to be easily used by humans or code agents to programmatically fetch LangSmith data for testing and debugging.

🚀 Quickstart
pip install langsmith-fetch
Set your LangSmith API key and project name:
export LANGSMITH_API_KEY=lsv2_...
export LANGSMITH_PROJECT=your-project-name
export LANGSMITH_ENDPOINT=your-langsmith-api-url # setting this if you use self-host langsmith
That's it! The CLI will automatically fetch traces or threads in LANGSMITH_PROJECT.
Fetch recent traces to directory (recommended):
langsmith-fetch traces ./my-traces --limit 10
Fetch specific trace by ID:
langsmith-fetch trace 3b0b15fe-1e3a-4aef-afa8-48df15879cfe
Same commands work for threads:
langsmith-fetch threads ./my-threads --limit 10
langsmith-fetch thread my-thread-id

Include metadata and feedback:
langsmith-fetch traces ./my-traces --limit 10 --include-metadata --include-feedback
For code agents:
Use langsmith-fetch to fetch recent LangSmith traces. Run langsmith-fetch --help for usage details.
Commands
| Command | What it fetches | Output |
|---|---|---|
trace <id> | Specific trace by ID | stdout or file |
thread <id> | Specific thread by ID | stdout or file |
traces [dir] | Recent traces (bulk) | Multiple JSON files in directory (RECOMMENDED) or stdout |
threads [dir] | Recent threads (bulk) | Multiple JSON files in directory (RECOMMENDED) or stdout |


