100 free credits. No credit card required.Start building
Logo
Content Analysis logo
100 free credits. No credit card required

Content Analysis Category Trends API

Scrape Content Analysis Category Trends data with one API call. Like phrase-trends, but keyed on a category code from the /content_analysis/categories taxonomy instead of a keyword. Returns a time series of mention volume and sentiment for an entire content category (e.g. Apparel) over a date range. Note the different mental model: this trends a category, not a brand term. With no filter every bucket covers citations from all countries, and its countries and languages maps are that bucket's breakdown; pass filters (for example country = DE) to count only one market's citations.

Last updated October 2026Maintained by the SocialCrawl team

Returns the same mention volume and sentiment time series as phrase-trends, but for a whole content category code rather than a keyword.

Use it to trend an entire category such as apparel; look the code up first with the categories endpoint.

Searching 69 platforms in parallel

·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·Apple Music logoApple Music·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Yelp logoYelp·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Finance logoFinance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility logoUtility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·Apple Music logoApple Music·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Yelp logoYelp·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Finance logoFinance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility logoUtility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·Apple Music logoApple Music·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Yelp logoYelp·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Finance logoFinance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility logoUtility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·Apple Music logoApple Music·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Yelp logoYelp·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Finance logoFinance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility logoUtility·Universal Search logoUniversal Search
Content Analysis API

What can you do with the Category Trends API?

The Category Trends endpoint gives you structured Content Analysis data with computed fields in a single request. No scraping infrastructure to build or maintain.

Example Request

# GET /v1/content_analysis/category-trends: 20 credits per call. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
# --max-time 60: the API's own time limit for this endpoint.
# --retry 3: retries timeouts, 429 and 5xx, honoring Retry-After.
# -o response.json keeps only the final attempt's body.
# One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
IDEMPOTENCY_KEY=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n')
curl -sS --max-time 60 --retry 3 -o response.json \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  "https://www.socialcrawl.dev/v1/content_analysis/category-trends?category_code=10021&date_from=2025-01-01&date_group=month" && cat response.json
# GET /v1/content_analysis/category-trends: 20 credits per call. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
import os
import random
import time
import uuid

import requests

API_KEY = os.environ.get("SOCIALCRAWL_API_KEY", "YOUR_API_KEY")
TIMEOUT_S = 60  # the API's own time limit for this endpoint.
MAX_RETRIES = 3
URL = "https://www.socialcrawl.dev/v1/content_analysis/category-trends"


def backoff(attempt):
    # Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
    return 2 ** attempt * (0.5 + random.random() / 2)


def socialcrawl(params):
    # One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
    idempotency_key = str(uuid.uuid4())
    for attempt in range(MAX_RETRIES + 1):
        try:
            res = requests.get(
                URL,
                params=params,
                headers={"x-api-key": API_KEY, "Idempotency-Key": idempotency_key},
                timeout=TIMEOUT_S,
            )
            body = res.json()
        except (requests.RequestException, ValueError):
            # A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
            if attempt == MAX_RETRIES:
                raise
            time.sleep(backoff(attempt))
            continue
        if body["success"]:
            return body
        error = body["error"]
        # Branch on error["type"], never on the message text.
        if error["type"] == "RESOURCE_NOT_FOUND":
            return None  # refunded: nothing to read
        retry_after = res.headers.get("Retry-After")
        # SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
        permanent = error["type"] == "SERVICE_UNAVAILABLE" and retry_after is None
        if not error.get("retryable") or permanent or attempt == MAX_RETRIES:
            raise RuntimeError(f"{error['type']}: {error['message']} (request_id {body['request_id']})")
        # Retry-After (seconds) wins; otherwise back off.
        time.sleep(float(retry_after) if retry_after else backoff(attempt))


params = {
    "category_code": "10021",
    "date_from": "2025-01-01",
    "date_group": "month",
}
body = socialcrawl(params)
if body is not None:
    print(body["data"])
// GET /v1/content_analysis/category-trends: 20 credits per call. Cache hits are free and failed calls are refunded.
// Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
const API_KEY = process.env.SOCIALCRAWL_API_KEY ?? "YOUR_API_KEY";
const TIMEOUT_MS = 60_000; // the API's own time limit for this endpoint.
const MAX_RETRIES = 3;

type Page = { next_cursor: string | null; has_more: boolean };
type SocialCrawlResponse =
  | { success: true; data: any; pagination?: Page; credits_used: number; request_id: string }
  | { success: false; error: { type: string; message: string; retryable: boolean }; request_id: string };

const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
// Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
const backoffMs = (attempt: number) => 2 ** attempt * 1000 * (0.5 + Math.random() / 2);

async function socialcrawl(url: URL) {
  // One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
  const idempotencyKey = crypto.randomUUID();
  for (let attempt = 0; ; attempt++) {
    let res: Response;
    let body: SocialCrawlResponse;
    try {
      res = await fetch(url, {
        headers: {
          "x-api-key": API_KEY,
          "Idempotency-Key": idempotencyKey,
        },
        signal: AbortSignal.timeout(TIMEOUT_MS),
      });
      body = (await res.json()) as SocialCrawlResponse;
    } catch (error) {
      // A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
      if (attempt >= MAX_RETRIES) throw error;
      await sleep(backoffMs(attempt));
      continue;
    }
    if (body.success) return body;
    // Branch on error.type, never on the message text.
    if (body.error.type === "RESOURCE_NOT_FOUND") return null; // refunded: nothing to read
    const retryAfter = res.headers.get("Retry-After");
    // SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
    const permanent = body.error.type === "SERVICE_UNAVAILABLE" && retryAfter === null;
    if (!body.error.retryable || permanent || attempt >= MAX_RETRIES) {
      throw new Error(`${body.error.type}: ${body.error.message} (request_id ${body.request_id})`);
    }
    // Retry-After (seconds) wins; otherwise back off.
    await sleep(retryAfter ? Number(retryAfter) * 1000 : backoffMs(attempt));
  }
}

const url = new URL("https://www.socialcrawl.dev/v1/content_analysis/category-trends");
url.searchParams.set("category_code", "10021");
url.searchParams.set("date_from", "2025-01-01");
url.searchParams.set("date_group", "month");

const body = await socialcrawl(url);
if (body) console.log(body.data);

Parameters

ParameterRequiredDescription
category_codeYesNumeric category code from the /content_analysis/categories taxonomy (e.g. 10021 = Apparel).
date_fromYesStart of the date range (yyyy-mm-dd).
date_toNoEnd of the date range (yyyy-mm-dd); defaults to today.
date_groupNoBucket size: day, week, or month (default month). (day | week | month)
internal_list_limitNoCap on internal arrays per bucket (1-20).
filtersNoAdvanced filter expression as a JSON array (≤8 conditions) over the citation fields listed by /content_analysis/filters, applied before the buckets are counted. Example: [["country","=","DE"]] for German-hosted citations, or [["language","=","de"]] for German-language ones.
Example Response

What does the Content Analysis Category Trends API return?

Every response follows one unified schema. Here is a real, unmodified response body, so you can see the exact fields you get back before spending a credit.

Example response
{
  "success": true,
  "platform": "content_analysis",
  "endpoint": "/v1/content_analysis/category-trends",
  "data": {
    "series": [
      {
        "type": "content_analysis_trends",
        "date": "2025-01-01",
        "total_count": 695856,
        "rank": 436,
        "top_domains": [
          {
            "domain": "aiseka.com",
            "count": 6192
          },
          {
            "domain": "lyst.com",
            "count": 5488
          }
        ],
        "sentiment_connotations": {
          "anger": 88,
          "happiness": 44192,
          "love": 57232,
          "sadness": 528,
          "share": 5080,
          "fun": 2960
        },
        "connotation_types": {
          "positive": 365928,
          "negative": 110504,
          "neutral": 223616
        },
        "text_categories": [
          {
            "category": [
              10013,
              10005
            ],
            "count": 10624
          },
          {
            "category": [
              10013,
              10021
            ],
            "count": 8336
          }
        ],
        "page_categories": [
          {
            "category": null,
            "count": 72536
          },
          {
            "category": [
              10004,
              13464
            ],
            "count": 4600
          }
        ],
        "page_types": {
          "blogs": 117632,
          "organization": 64864,
          "news": 17640,
          "message-boards": 12120,
          "ecommerce": 294456
        },
        "countries": {
          "US": 61496,
          "DE": 18064,
          "GB": 15608,
          "WW": 14168,
          "FR": 12264,
          "IN": 9448,
          "BR": 8088,
          "ID": 6528,
          "DK": 6432,
          "NL": 4920
        },
        "languages": {
          "en": 472560,
          "ja": 73416,
          "de": 34688,
          "id": 19104,
          "fr": 19048,
          "es": 12552,
          "nl": 9624,
          "da": 8800,
          "pt": 7464,
          "vi": 4336
        }
      },
      {
        "type": "content_analysis_trends",
        "date": "2025-02-01",
        "total_count": 796704,
        "rank": 438,
        "top_domains": [
          {
            "domain": "codefund.online",
            "count": 8336
          },
          {
            "domain": "aiseka.com",
            "count": 6424
          }
        ],
        "sentiment_connotations": {
          "anger": 256,
          "happiness": 45896,
          "love": 68032,
          "sadness": 416,
          "share": 4728,
          "fun": 3744
        },
        "connotation_types": {
          "positive": 387432,
          "negative": 136096,
          "neutral": 246736
        },
        "text_categories": [
          {
            "category": [
              10013,
              10005
            ],
            "count": 20032
          },
          {
            "category": [
              10013,
              10021
            ],
            "count": 12464
          }
        ],
        "page_categories": [
          {
            "category": null,
            "count": 105736
          },
          {
            "category": [
              10018,
              13414
            ],
            "count": 8456
          }
        ],
        "page_types": {
          "blogs": 116832,
          "organization": 48136,
          "news": 15768,
          "message-boards": 14112,
          "ecommerce": 406544
        },
        "countries": {
          "US": 76280,
          "DE": 31848,
          "WW": 21000,
          "GB": 15544,
          "FR": 12880,
          "BR": 12104,
          "DK": 11872,
          "IN": 8728,
          "IT": 5432,
          "NL": 5184
        },
        "languages": {
          "en": 476688,
          "ja": 98320,
          "de": 49224,
          "zh-CN": 30032,
          "fr": 22448,
          "es": 16776,
          "da": 16504,
          "nl": 15400,
          "id": 11992,
          "pt": 11072
        }
      }
    ]
  },
  "credits_used": 20,
  "request_id": "req_example000000",
  "cached": false,
  "credits_remaining": 9999,
  "source": "captured",
  "captured_at": "2026-10-02T13:06:06.884Z",
  "redacted": true
}

Live sample illustrating the unified response shape. Field values reflect the record you query.

API Details

How does the Content Analysis Category Trends API work?

Send a GET request with your API key and get back clean, structured JSON in our unified schema. Supported computed fields are populated when the source provides the required inputs.

Method

GET

Response

JSON

Why SocialCrawl

Why use SocialCrawl for Content Analysis Category Trends data?

We handle the complexity of Content Analysis data extraction so you can focus on building. Unified schema, AI enrichment, and zero platform logic in your code.

Developer First

How do you scrape social media data in seconds?

The fastest social media scraping API for developers. Scrape profiles, posts, comments, and analytics from 69 platforms covering 10B+ monthly active users.

One schema, every platform

Query 69 platforms with identical response structures. Write your integration once.

Computed fields, not just scraped

When an endpoint supports these metrics and the source provides the required inputs, the normalized record includes engagement_rate, estimated_reach, content_category, and language. Ready to use.

See your data before you code

Visual Data Explorer. Paste any URL, get rich result cards, sortable tables, CSV export.

import requests

response = requests.get(
    'https://www.socialcrawl.dev/v1/tiktok/profile',
    params={'handle': 'charlidamelio'},
    headers={'x-api-key': 'sc_YOUR_API_KEY'}
)
data = response.json()
[ .JSON ]
{
  "success": true,
  "platform": "tiktok",
  "data": {
    "author": {
      "username": "charlidamelio",
      "followers": 152400000
    },
    "engagement": {
      "likes": 12400000000,
      "engagement_rate": 0.087
    },
    "metadata": {
      "language": "en",
      "content_category": "lifestyle"
    }
  }
}
+ 69 platforms
FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
How do I track a content category over time with an API?
Send a GET request to /v1/content_analysis/category-trends with a numeric category_code and a date_from. Unlike phrase-trends, this endpoint keys on a category, not a keyword. It returns a time series of mention volume and sentiment for that whole content category.
Why does category-trends use a category_code instead of a keyword?
It is the odd one out among the trends endpoints. Category-trends tracks an entire content category rather than a single term, so it takes a numeric category_code from the categories taxonomy plus date_from, not a keyword you type.
Where do I find a category_code?
Call the categories endpoint (/v1/content_analysis/categories) to browse the 3,000+ node taxonomy and pick the numeric code for the topic you want, then pass that code to category-trends. Apparel, for example, is code 10021.
What parameters does category-trends take?
category_code and date_from (yyyy-mm-dd) are required. date_to defaults to today, and date_group sets day, week, or month buckets (month is the default). The response is a date-bucketed series of mention and sentiment points for the category.
How much does the category trends API cost?
Each category-trends request costs 20 credits on the advanced tier. New accounts get 100 free credits with no credit card required, so you can chart category trends across several codes and date ranges before you pay anything.

Ask AI about SocialCrawl

Ready to scrape Content Analysis Category Trends data?

Get your API key and start pulling Content Analysis data in under 60 seconds.

Start for free

🤖 AI agent or LLM? Read this page as markdown