# CleanFetch agent skill

Use this skill to fetch public social media data from CleanFetch. One key, one JSON envelope, every platform.

## Base

- Base URL: `https://api.cleanfetch.dev/v1`
- Auth header: `x-api-key: cf_live_...`
- All requests are `GET` unless noted. Responses are JSON.

## Response envelope

```json
{
  "data": { "platform": "linkedin", "fullName": "Bill Gates" },
  "meta": {
    "requestId": "req_cf_01j9k8m2x9p",
    "lookupStatus": "found",
    "creditsCharged": 5,
    "cached": false
  }
}
```

`meta.lookupStatus` is `found`, `not_found`, `private` or `restricted`. A verified miss bills the endpoint price; an upstream failure, rate limit or cache hit bills nothing. Always log `meta.requestId` when reporting an issue.

## Endpoints

| Endpoint | Credits | Returns |
| --- | --- | --- |
| `/v1/linkedin/profile` | 6 | Public profile |
| `/v1/linkedin/email` | 20 (paid) | Work email |
| `/v1/linkedin/batch` | 18 (paid) | Up to 3 profiles |
| `/v1/instagram/profile` | 4 | Profile + stats |
| `/v1/tiktok/profile` | 4 | Profile + stats |
| `/v1/tiktok/video` | 7 (paid) | Video detail |
| `/v1/youtube/transcript` | 4 | Timed transcript |
| `/v1/x/profile` | 1 | Profile + stats |
| `/v1/google-trends/interest` | 1 | Interest over time |

## Quick call

```bash
curl -s "https://api.cleanfetch.dev/v1/linkedin/profile?url=https://linkedin.com/in/williamhgates" \
  -H "x-api-key: $CLEANFETCH_API_KEY"
```

```ts
const res = await fetch(`https://api.cleanfetch.dev/v1/linkedin/profile?url=${encodeURIComponent(url)}`, {
  headers: { 'x-api-key': process.env.CLEANFETCH_API_KEY! },
});
const { data, meta } = await res.json();
```

## Rules for agents

- Prefer `?url=` with a full public profile or video URL; X takes `?username=`.
- LinkedIn batch accepts up to 3 profile URLs and costs 18 credits per request.
- Cache hits cost zero. A repeat call bills again only when `meta.cached` is false.
- Do not retry `402 insufficient_credits` or `402 free_tier_exhausted`; surface the upgrade URL instead.
- Free accounts receive 30 credits (valid 30 days) with 2-10 daily calls on public endpoints. TikTok video, LinkedIn email, and LinkedIn batch require a paid plan.
- Retry `429 rate_limited` after the `Retry-After` header; that attempt is not charged. Retry 5xx with backoff; those attempts are not charged either.

## MCP

Hosted MCP server: `https://api.cleanfetch.dev/mcp` (OAuth, or pass the API key). Tool names mirror the endpoint paths above.

## Free tools

- [LinkedIn Profile Viewer](https://cleanfetch.dev/tools/linkedin-profile-viewer): Inspect any public LinkedIn profile anonymously without signing in. Returns both a clean summary card and the exact API JSON payload.
- [X / Twitter Profile Viewer](https://cleanfetch.dev/tools/twitter-viewer): View public X (Twitter) profiles, bio metrics, and recent posts anonymously without logging into X.
- [TikTok Transcript Extractor](https://cleanfetch.dev/tools/tiktok-transcript): Extract timestamped captions and clean spoken text from any public TikTok video URL in one request.
- [Instagram Profile Viewer](https://cleanfetch.dev/tools/instagram-profile-viewer): Check public Instagram creator profiles, follower counts, bio links, and engagement snapshots anonymously.
- [YouTube Transcript API Viewer](https://cleanfetch.dev/tools/youtube-transcript): Pull clean, timestamped YouTube video transcripts ready for RAG pipelines and LLM summaries.
- [LinkedIn People Search](https://cleanfetch.dev/tools/linkedin-people-search): Search public LinkedIn profiles by role, company, or region and inspect normalized JSON results.
- [Reddit Thread & Subreddit Viewer](https://cleanfetch.dev/tools/reddit-research): Fetch clean subreddit posts, nested comment trees, and sentiment metadata without Reddit API approval.
- [Social Ad Library Inspector](https://cleanfetch.dev/tools/ad-library-inspector): Inspect active competitor creatives across Meta, TikTok, and LinkedIn Ad Libraries in structured JSON.

## Docs

- [Overview](https://cleanfetch.dev/docs/overview): One key, one JSON envelope and 1,158 public endpoints across 87 platforms. Start with the shape before the individual sources.
- [Quickstart](https://cleanfetch.dev/docs/quickstart): Make a first live request in under a minute: create a key, send one header and read the envelope.
- [Authentication](https://cleanfetch.dev/docs/authentication): Server-side keys, one header and a clean rotation path. Test keys and live keys share the same request shape.
- [Credits & Billing](https://cleanfetch.dev/docs/credits): The billing rules in one page: verified misses cost once, upstream failures cost nothing, and every response reports what was charged.
- [Rate Limits & Errors](https://cleanfetch.dev/docs/rate-limits): Retry the right failures, never retry the wrong ones, and use requestId to trace any result.
- [LinkedIn API](https://cleanfetch.dev/docs/endpoints-linkedin): Public profiles, companies, posts, people search and ad transparency in one normalized record.
- [Instagram API](https://cleanfetch.dev/docs/endpoints-instagram): Public profiles, post grids, reels, captions and engagement counts without a logged-in session.
- [TikTok API](https://cleanfetch.dev/docs/endpoints-tiktok): Video metadata, transcripts with timestamps, profile stats and comment threads from public posts.
- [X API](https://cleanfetch.dev/docs/endpoints-x): Public profiles, recent posts, replies and search results without an X developer account or OAuth review.
- [YouTube API](https://cleanfetch.dev/docs/endpoints-youtube): Video metadata, channel inventories, transcripts and comment threads with one request shape.
- [Reddit API](https://cleanfetch.dev/docs/endpoints-reddit): Subreddit feeds, nested comment trees and post detail without a Reddit OAuth app or API review.
- [Hosted MCP & skill.md](https://cleanfetch.dev/docs/mcp-and-skills): Give an agent a typed tool surface and a readable spec. No local server, no copied endpoint list.
- [SDKs & Frameworks](https://cleanfetch.dev/docs/sdks): Use fetch, requests or an agent framework. The API is plain HTTP and needs no generated client.
- [Automation](https://cleanfetch.dev/docs/automation): Wire CleanFetch into n8n, Make or Pipedream with an HTTP request and one header.

## Compare

- [CleanFetch vs Social Fetch](https://cleanfetch.dev/compare/social-fetch): Both APIs give you one key and one JSON envelope without account maintenance. CleanFetch publishes a credit price for every endpoint and a 10% annual discount, with no compute-unit math.
- [CleanFetch vs Apify](https://cleanfetch.dev/compare/apify): Apify is built for batch scraping jobs with actor cold starts and separate Compute Unit charges. CleanFetch wraps social data into synchronous, single-bill REST endpoints.
- [CleanFetch vs Official LinkedIn API](https://cleanfetch.dev/compare/linkedin-api): LinkedIn’s official API restricts public profile lookups behind strict Marketing/Partner approvals. CleanFetch lets any developer query public profiles cleanly in seconds.

## Coverage

[All 87 platforms](https://cleanfetch.dev/platforms), including LinkedIn, Instagram, X (Twitter), Facebook, Threads, Bluesky, Mastodon, Pinterest and more.

Pricing: https://cleanfetch.dev/pricing. Free tier: 2-5 calls/day on public endpoints, plus 100 credits after email verification. No card required.
