# LangSmith Public Prompt Dataset & Template Extractor (MCP) (`gridline-labs/langsmith-prompts-scraper`) Actor

Extract 10,800+ public LangSmith Prompt Hub templates with parsed system/human messages, inputVariables, downloads & manifest JSON. Fast 256 MB HTTP-only Actor for LLM evals & MCP.

- **URL**: https://apify.com/gridline-labs/langsmith-prompts-scraper.md
- **Developed by:** [Gridline Labs](https://apify.com/gridline-labs) (community)
- **Categories:** Developer tools, Automation, AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## LangSmith Public Prompt Dataset & Template Extractor (MCP)

Extract clean, evaluation-ready prompt datasets from **10,800+ public LangSmith / LangChain Prompt Hub repositories** — including downloads, likes, views, tags, creators, and an automatic **LangChain Manifest Parser** that unpacks raw serialized JSON into clean **`messages[]`**, **`inputVariables[]`**, and readable **`promptText`**.

Built **100% HTTP-only** on **256 MB RAM** by **[Gridline Labs](https://gridlinelabs.vercel.app)** — zero proxies or API keys required, ready for **LLM evaluations, prompt optimization, RAG benchmarks, and Apify MCP agents**.

> **Free Live Sample Dataset & Prompt Benchmarks:** Preview real parsed prompt structures, variable stats & download sample JSON/CSV before running → **[gridlinelabs.vercel.app/datasets](https://gridlinelabs.vercel.app/datasets#langsmith)**

***

### Why Teams Use This Actor

- **Skip Raw LangChain Manifest Parsing:** LangSmith's raw commit manifests nest `ChatPromptTemplate`, `SystemMessagePromptTemplate`, `HumanMessagePromptTemplate`, `MessagesPlaceholder`, and `RunnableSequence` JSON objects. With `includePromptTemplate: true`, our parser automatically unpacks them into flat, structured `messages[]`, `inputVariables[]`, and clean `promptText`.
- **LLM Benchmarking & Eval Datasets:** Pull top-downloaded RAG, ReAct agent, SQL, extraction, and grading prompts sorted by real production adoption (`downloads`, `likes`, `views`, or `updated`).
- **AI Agent Context via MCP:** Connect straight into Claude Desktop, Cursor, or LangGraph to pull proven community system prompts on demand.
- **Scheduled Prompt Monitoring (`onlyNew: true`):** Track newly published prompts matching your tags or keywords while skipping previously seen repos at **`$0` cost**.

***

### Connect to Claude Desktop / Cursor via Apify MCP

```json
{
  "mcpServers": {
    "apify-langsmith-prompts": {
      "url": "https://mcp.apify.com/?tools=gridline-labs/langsmith-prompts-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

Example agent prompt: *"Fetch the top 15 most-downloaded RAG evaluation prompts from LangSmith Prompt Hub with their parsed system/human messages and input variables."*

***

### Quick Python Eval Pipeline Example

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("gridline-labs/langsmith-prompts-scraper").call(run_input={
    "searchQueries": ["rag", "agent"],
    "sortBy": "downloads",
    "includePromptTemplate": True,
    "maxResults": 100,
})

prompts = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(prompts[0]["fullName"], prompts[0]["inputVariables"], prompts[0]["promptText"][:140])
```

***

### Sample Output (`includePromptTemplate: true`)

```json
{
  "fullName": "rlm/rag-prompt",
  "owner": "rlm",
  "handle": "rag-prompt",
  "downloads": 1482910,
  "likes": 1042,
  "views": 389120,
  "tags": ["ChatPromptTemplate", "QA over documents", "RAG"],
  "templateType": "ChatPromptTemplate",
  "inputVariables": ["context", "question"],
  "messagesCount": 1,
  "messages": [
    {
      "role": "human",
      "template": "You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question..."
    }
  ],
  "promptText": "You are an assistant for question-answering tasks...",
  "url": "https://smith.langchain.com/hub/rlm/rag-prompt"
}
```

***

### Transparent Pay-Per-Event (PPE) Pricing

| Event | Price | When charged |
| :--- | :---: | :--- |
| **Prompt repository record** (`prompt-item`) | **$0.002** (`$2 / 1,000`) | Per matching prompt delivered |
| **Parsed prompt template** (`prompt-template-detail`) | **$0.003** (`$3 / 1,000`) | Only when `includePromptTemplate: true` succeeds |

*Filtered-out records and previously seen `onlyNew` monitor items cost `$0`. Use `maxResults` or Apify `maxTotalChargeUsd` to cap spend per run.*

***

### More Tools by Gridline Labs

- **[n8n Workflow JSON Extractor for AI Agents & RAG](https://apify.com/gridline-labs/n8n-workflows-scraper)** — 14,000+ n8n workflows, apps, views, paid prices & full importable JSON.
- **[GridSnap for Chrome](https://gridlinelabs.vercel.app/gridsnap)** — 1-click HTML Table & React ARIA Grid exporter to native Excel (`.xlsx`), CSV, JSON & SQL.
- **[AgentReady Website Auditor](https://gridlinelabs.vercel.app/audit)** — Free AI Search & `llms.txt` readiness checker.

*Independent tool by [Gridline Labs](https://gridlinelabs.vercel.app) (not affiliated with or endorsed by LangChain, Inc.).*

# Actor input Schema

## `searchQuery` (type: `string`):

Optional search keyword matching prompt handle, description, or README (e.g. 'rag', 'agent', 'sql', 'extraction', 'summarization'). Leave empty to browse top prompts.

## `tags` (type: `array`):

Optional LangSmith Prompt Hub tags (e.g. 'ChatPromptTemplate', 'QA over documents', 'Agents', 'English', 'OpenAI').

## `owners` (type: `array`):

Optional list of prompt creator/org handles (e.g. 'rlm', 'hwchase17', 'langchain-ai').

## `repoHandles` (type: `array`):

Optional direct prompt slugs or URLs (e.g. 'rlm/rag-prompt', 'hwchase17/react'). When set, fetches these exact prompts directly.

## `sortBy` (type: `string`):

Server-side sort field on LangSmith Prompt Hub.

## `minDownloads` (type: `integer`):

Skip prompts with fewer downloads than this threshold (skipped rows cost $0).

## `minLikes` (type: `integer`):

Skip prompts with fewer likes than this threshold.

## `includePromptTemplate` (type: `boolean`):

Fetches each prompt's latest commit to extract parsed system/human/ai messages, readable promptText, inputVariables\[], and LangChain manifest JSON. Triggers prompt-template-detail ($0.003/prompt).

## `includeRawManifest` (type: `boolean`):

When includePromptTemplate is true, also attach the raw serialized LangChain manifest JSON object.

## `onlyNew` (type: `boolean`):

Persist seen prompt IDs across scheduled runs and emit only newly published prompts (previously seen prompts cost $0).

## `monitorKey` (type: `string`):

State key for Monitor Mode.

## `maxResults` (type: `integer`):

Maximum number of matching prompts to deliver.

## Actor input object example

```json
{
  "searchQuery": "",
  "tags": [],
  "owners": [],
  "repoHandles": [],
  "sortBy": "downloads",
  "minDownloads": 0,
  "minLikes": 0,
  "includePromptTemplate": false,
  "includeRawManifest": false,
  "onlyNew": false,
  "monitorKey": "default",
  "maxResults": 50
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gridline-labs/langsmith-prompts-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gridline-labs/langsmith-prompts-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gridline-labs/langsmith-prompts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gridline-labs/langsmith-prompts-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/w3NUggnWScICe7N6w/builds/bbmTDGZl0OF8IfRLn/openapi.json
