---
agent:
  instructions: "Search the SocialTap docs with keywords or a question instead of crawling pages: GET https://socialtap.dev/.well-known/search?q={query} returns the best sections as Markdown (JSON with Accept: application/json), free and without a key."
  endpoint: "https://socialtap.dev/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://socialtap.dev/docs/agents/#docs-for-agents"
---
# Analyses

> Setting SocialTap up for your user? Follow https://socialtap.dev/setup.md.

Using the API

Add typed values to each item you fetch, such as its sentiment or buying intent, filter a list on them, and know what each costs.

An analysis is a typed value we add to each item an endpoint returns. It is one of a list of values, true or false, a score from 0 to 1, or a list of objects. Ask for it with `analysis` and read it under `data.analysis`:

cURL:

```shell
curl -G 'https://socialtap.dev/v1/tiktok/post' \
  --data-urlencode 'url=https://www.tiktok.com/@scout2015/video/6718335390845095173' \
  --data-urlencode 'analysis=sentiment' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
```

Shape of data.analysis:

```json
{
  "sentiment": "positive",
  "sentiment_probability": 0.85
}
```

Values are examples.

The item's own fields come back as always, with an `analysis` object beside them holding only the analyses you asked for, each under its own name. Ask for several at once, comma-separated: they cost what one costs when they read the same thing (see Price).

## What each analysis returns

Each analysis has a reference page with its meaning, its values, the inputs it reads, the languages it answers in and the endpoints that offer it. Each endpoint's reference page lists the analyses it offers.

| Analysis | What it answers | Price |
| --- | --- | --- |
| [`account_kind`](https://socialtap.dev/docs/analyses/account-kind/index.md) | Who runs the account: a creator, a brand, a local business, a media publisher, a public figure, an organization, a fan or aggregator page, or a private person. | Text |
| [`aspects`](https://socialtap.dev/docs/analyses/aspects/index.md) | The aspects a review judges (quality, value, customer service, delivery, food, cleanliness, …), each with its sentiment and the probability that is right. | Text |
| [`attack_target`](https://socialtap.dev/docs/analyses/attack-target/index.md) | Whom the item attacks, if anyone: an individual, an identity group (by race, religion, gender, sexuality, nationality or disability), an organization, another group, or none. | Text |
| [`authenticity_risk`](https://socialtap.dev/docs/analyses/authenticity-risk/index.md) | How likely the review is fake, paid or incentivized rather than a customer's own experience (0 to 1): generic praise or attack with no specifics, marketing language, a rating its words contradict, or a product received free. | Text |
| [`brand_mentions`](https://socialtap.dev/docs/analyses/brand-mentions/index.md) | For each of the caller's brands (brand=Notion,Linear, or JSON with aliases, handles and domains): whether the item mentions it, not something else of that name, and how it speaks of it. | Text |
| [`brand_safety`](https://socialtap.dev/docs/analyses/brand-safety/index.md) | The item's risk for an advertiser in each of the 12 categories of GARM's brand safety framework, every category with its level (none, low, medium, high, floor) and the probability that is right. | Text |
| [`buying_intent`](https://socialtap.dev/docs/analyses/buying-intent/index.md) | How likely the author is looking to buy, hire or switch to a product or service (0 to 1); with about, one like the caller's. | Text |
| [`comment_kind`](https://socialtap.dev/docs/analyses/comment-kind/index.md) | What kind of comment it is: a genuine reaction or question, a low-effort generic one, self-promotion, spam, or a scam. | Text |
| [`criteria`](https://socialtap.dev/docs/analyses/criteria/index.md) | The caller's own yes/no questions answered for the item (criteria=\["asks for a refund?"\]), each true or false with its probability. | Text |
| [`disclosure`](https://socialtap.dev/docs/analyses/disclosure/index.md) | Whether the item clearly discloses a commercial relationship (#ad, #sponsored, paid partnership, affiliate link, gifted), with its probability; read with promotion_type, an undisclosed promotion. | Text |
| [`entities`](https://socialtap.dev/docs/analyses/entities/index.md) | The people, organizations, products, places, events and works the item names, each with what it is and the probability that is right. | Text |
| [`format`](https://socialtap.dev/docs/analyses/format/index.md) | The video's format: talking to camera, tutorial, product demo, unboxing, review, vlog, skit, meme, music or dance, slideshow, screen recording, interview or podcast, news, gameplay, animation, a produced ad, or other. | Per video |
| [`image_safety_labels`](https://socialtap.dev/docs/analyses/image-safety-labels/index.md) | What a moderator would flag in the item's images: sexual content, violence, self-harm, hate, harassment, drugs, weapons, profanity or a scam; each that applies, with its probability. | Per image |
| [`labels`](https://socialtap.dev/docs/analyses/labels/index.md) | Which of the caller's own labels fit the item (labels=bug,feature_request,praise), most likely first, each with its probability. | Text |
| [`language`](https://socialtap.dev/docs/analyses/language/index.md) | The language the item is written in (BCP 47 code: en, pt, ja), as the platform states it or read from its words; null when too short to tell. | Free |
| [`maintenance_status`](https://socialtap.dev/docs/analyses/maintenance-status/index.md) | Whether the repository is archived, active (pushed to within 30 days), maintained (within 6 months), stale (6 months to 2 years) or abandoned (over 2 years); null when the platform shows neither. | Free |
| [`near_duplicate_of`](https://socialtap.dev/docs/analyses/near-duplicate-of/index.md) | The ID of an earlier item on the same page with nearly the same words (copy-pasted or lightly edited); null when the page holds none. | Free |
| [`niches`](https://socialtap.dev/docs/analyses/niches/index.md) | The content niches the account works in (beauty, fitness, food, gaming, tech, finance, …), each that applies, with its probability. | Text |
| [`outlier_score`](https://socialtap.dev/docs/analyses/outlier-score/index.md) | The post's views divided by the median views of its creator's latest posts: 1 is typical, 5 is five times their usual; null when views aren't shown. | Pages it reads |
| [`owner_response_rate`](https://socialtap.dev/docs/analyses/owner-response-rate/index.md) | The share of the place's newest reviews its owner replied to, from 0 to 1 (the newest page of reviews the platform shows anyone); null without reviews. | Pages it reads |
| [`promotion_type`](https://socialtap.dev/docs/analyses/promotion-type/index.md) | What the item promotes, if anything: a paid partnership, affiliate links or codes, a gifted product, the author's own business, or none. | Text |
| [`rating_trend`](https://socialtap.dev/docs/analyses/rating-trend/index.md) | The average rating of the place's newest reviews minus its overall rating, in stars: -0.8 means recent reviewers rate it 0.8 stars below its average; null without both. | Pages it reads |
| [`relevance`](https://socialtap.dev/docs/analyses/relevance/index.md) | How likely the item is about what the caller's about describes: the same need, problem or kind of product (0 to 1). | Text |
| [`safety_labels`](https://socialtap.dev/docs/analyses/safety-labels/index.md) | What a moderator would flag in the item's words: sexual content, violence, self-harm, hate, harassment, drugs, weapons, profanity or a scam; each that applies, with its probability. | Text |
| [`segments`](https://socialtap.dev/docs/analyses/segments/index.md) | The spans of a transcript that aren't the video's own content: sponsor reads, self-promotion, reminders to like and subscribe, intros and outros, each with its start and end and its probability. | Text |
| [`sentiment`](https://socialtap.dev/docs/analyses/sentiment/index.md) | The overall feeling the author expresses: positive, negative, neutral, or mixed (clearly both). | Text |
| [`themes`](https://socialtap.dev/docs/analyses/themes/index.md) | What the item does: a pain point, a request for a fix or advice, money talk, an idea, praise, news or self-promotion; each that applies, with its probability. | Text |
| [`topics`](https://socialtap.dev/docs/analyses/topics/index.md) | What the item is about, as categories of the IAB Content Taxonomy's top level (most likely first; at most three), each with its probability. | Text |
| [`toxicity`](https://socialtap.dev/docs/analyses/toxicity/index.md) | How likely the item is rude, insulting, harassing, hateful, threatening or profane toward someone (0 to 1). | Text |
| [`video_brand_safety`](https://socialtap.dev/docs/analyses/video-brand-safety/index.md) | The video's risk for an advertiser (what it shows, writes and says) in each of the 12 categories of GARM's brand safety framework, every category with its level and the probability that is right. | Per video |
| [`video_safety_labels`](https://socialtap.dev/docs/analyses/video-safety-labels/index.md) | What a moderator would flag in the item's video (what it shows, writes and says): sexual content, violence, self-harm, hate, harassment, drugs, weapons, profanity or a scam; each that applies, with its probability. | Per video |

A classification (one value, true or false, or a list of values) has a `<name>_probability` sibling: how sure the answer is, from 0 to 1. A list of objects whose entries are classifications carries a `probability` on each entry. A score is itself a probability, and a value computed from the item's fields is certain: neither has a sibling.

A value's list only grows. Treat a value you don't know as "other".

## Parameters

| Parameter | Read by | Description |
| --- | --- | --- |
| `analysis` | every analysis | Analyses to add to each item, comma-separated (sentiment,buying_intent): each answers under data.analysis.\<name>, with \<name>_probability beside a classification. Priced by what they read: text analyses add a flat extra per page, image analyses per image, video analyses per video. Omit for none. |
| `about` | [buying_intent](https://socialtap.dev/docs/analyses/buying-intent/index.md), [relevance](https://socialtap.dev/docs/analyses/relevance/index.md) | What you sell or look for, in a sentence: the relevance and buying_intent analyses judge each item against it. |
| `brand` | [brand_mentions](https://socialtap.dev/docs/analyses/brand-mentions/index.md) | Brands for brand_mentions: names, comma-separated (Notion,Linear), or a JSON array of names or {"name", "aliases", "handles", "domains"} objects. |
| `labels` | [labels](https://socialtap.dev/docs/analyses/labels/index.md) | Your own categories for the labels analysis, comma-separated or a JSON array: each item gets the ones that fit. |
| `criteria` | [criteria](https://socialtap.dev/docs/analyses/criteria/index.md) | Your yes/no questions for the criteria analysis, as a JSON array of strings (\["asks for a refund?"\]): each item gets true or false per question, with its probability. |

The inputs are yours: send them only with the analyses that read them. A request is refused with [`invalid_input`](https://socialtap.dev/docs/errors/index.md#invalid_input), free, when it:

- asks for an analysis the endpoint doesn't offer,
- leaves out an input an analysis needs,
- or sends an input none of its analyses reads.

`criteria`, and `brand` with aliases, take a JSON array, URL-encoded in a query.

## Filter a list with where

On a list endpoint, `where` keeps only the items that pass every condition. Each condition is `<path><op><value>` over the paths `fields` takes, `analysis.<name>` included, with `>=`, `<=`, `=`, `!=` or `~` (contains). Separate conditions with commas, or send a JSON array when a value has a comma.

cURL:

```shell
curl -G 'https://socialtap.dev/v1/amazon/reviews' \
  --data-urlencode 'url=https://www.amazon.co.uk/dp/0735211299' \
  --data-urlencode 'analysis=authenticity_risk' \
  --data-urlencode 'where=analysis.authenticity_risk>=0.7' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
```

- A null value never passes: an item whose analysis is unknown is dropped.
- A list passes when one of its values does, so `analysis.<name>=<value>` keeps the items that have that value.
- `limit` counts the items fetched, not the items kept, and `page.next_cursor` continues after the last item fetched.

> [!WARNING]
>
> Every judged item is charged whether or not it passes `where`, so a page can hold fewer items than `limit`, or none.

`where` filters on any field, not only analyses (`metrics.comment_count>=5`). A [monitor](https://socialtap.dev/docs/monitors/index.md) carries `where` in its params, so it reports only the new items that pass.

## Price

An analysis is priced by what it reads, on top of the endpoint's own price. Each class has one rule:

| Price class | What it adds to a request |
| --- | --- |
| **Text** | A flat extra per page, however many text analyses you ask for; a single item is a page of one. Each endpoint's reference page states it. |
| **Per image** | 3 credits per image, up to 4 images an item. |
| **Per video** | 30 credits per video, up to 3 minutes long. |
| **Pages it reads** | The pages it reads, each at its endpoint's price, once per request. |
| **Free** | Nothing: computed from the item's own fields. |

- **Text** is a flat extra per page whatever text analyses you ask for, sized for a full page of the endpoint. A page with fewer items judged (a smaller `limit`, items whose values were already computed) costs proportionally less.
- **Image** analyses judge an item's first 4 images.
- **Video** analyses read videos up to 3 minutes long.

`max_credits` still caps the whole request, analyses included. The [credits guide](https://socialtap.dev/docs/credits/index.md) has how a request is charged.

### What is free

- An analysis that couldn't be computed this time.
- An item in a language the analysis doesn't answer in.
- An item without what the analysis reads: no words, image or video.
- A video longer than 3 minutes.
- An analysis while analyses are paused.
- A value already computed for the same item, analysis and inputs.

A request answered from the cache with `max_age` still pays for the analyses it computes.

## Null values

A requested analysis is `null` on an item when its value is unknown. The answer's `meta.warnings` then carries an `analysis_unavailable` warning that names the analysis, how many items it is null on and why, and lists the paths in its `fields`:

| Why | What to do |
| --- | --- |
| It couldn't be computed this time | Repeat the request. |
| Analyses are paused for now | Repeat the request later. |
| The item's language isn't one the analysis answers in | Nothing: the same item gets null again. |
| The item's video is longer than 3 minutes | Nothing: the same video gets null again. |
| The item has nothing the analysis reads | Nothing: an item without words, images or a video has no value. |

None of these is charged. A list analysis with no value that applies is `[]`, not `null`.

## Languages

Each analysis answers for items in the languages listed on its reference page. We read the item's language from the platform when it states one, else from its words. An analysis computed from the item's fields answers in any language.

---

[HTML version](https://socialtap.dev/docs/analyses/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
