---
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"
---
# Evaluate SocialTap

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

Get started

Compare SocialTap with another social media API fairly: the same inputs, the cost of each successful result, null as unknown, and the pitfalls.

Run a fair comparison of SocialTap with another social media API: send both the same inputs, count what each successful result cost, and read every answer the same way. This page is for the developer or the agent running the test.

The shortest test is one request. This calls the [TikTok Profile API](https://socialtap.dev/docs/reference/tiktok/profile/index.md) with its example input; send the same input to the other API, then compare the two answers and what each cost (`meta.credits_charged` here):

cURL:

```shell
curl 'https://socialtap.dev/v1/tiktok/profile?handle=nasa' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
```

TypeScript SDK:

```typescript
// Save this as app.mjs (an ES module) and run: node app.mjs
import { SocialTap } from "socialtap";

const client = new SocialTap(); // apiKey defaults to process.env.SOCIALTAP_API_KEY

const res = await client.tiktok.profile.get({ handle: "nasa" });
console.log(res.data);
console.log(res.credits.charged, res.meta.request_id);
```

Python SDK:

```python
from socialtap import SocialTap

client = SocialTap()  # api_key defaults to os.environ["SOCIALTAP_API_KEY"]

res = client.tiktok.profile.get(handle="nasa")
print(res.data)
print(res.credits.charged, res.meta.request_id)
```

Go SDK:

```go
package main

import (
	"context"
	"fmt"
	"log"

	socialtap "socialtap.dev/sdk/go"
)

func main() {
	ctx := context.Background()
	client, err := socialtap.NewClient() // the API key defaults to $SOCIALTAP_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	res, err := client.TikTok.Profile.Get(ctx, socialtap.TikTokProfileParams{Handle: "nasa"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(res.Data)
	fmt.Println(res.Credits.Charged, res.Meta.RequestID)
}
```

## Start with the endpoints people use most

Each row is a kind of data people ask for most, on the platform they ask for it most. Every other endpoint is in the [API reference](https://socialtap.dev/docs/reference/index.md).

| Data | Try first | Price |
| --- | --- | --- |
| Posts | [TikTok Post API](https://socialtap.dev/docs/reference/tiktok/post/index.md) | 1 credit |
| Profiles | [TikTok Profile API](https://socialtap.dev/docs/reference/tiktok/profile/index.md) | 1 credit |
| Comments | [TikTok Comments API](https://socialtap.dev/docs/reference/tiktok/comments/index.md) | 1 credit per page |
| Transcripts | [TikTok Transcript API](https://socialtap.dev/docs/reference/tiktok/transcript/index.md) | 1 credit (captions) or 2 credits + 2 per started minute of media (speech-to-text, automatic up to 3 minutes, longer with transcribe_audio=true) |
| Ads | [TikTok Ad Library Search API](https://socialtap.dev/docs/reference/tiktok/search-ads/index.md) | 1 credit per page |
| Hashtags | [TikTok Hashtag API](https://socialtap.dev/docs/reference/tiktok/hashtag/index.md) | 1 credit |

For any other need, ask the MCP server's `find_endpoint` tool in plain words or with a link. It names the endpoint, its arguments and its price, free and without a key. The script below uses it.

## Send every vendor the same inputs

- **Pick the inputs first.** Use real links, handles and searches from your own product. Mix large and small accounts, new and old posts, and a few that should fail (a deleted post, a private account).
- **Send each input to every vendor within minutes.** Counts change by the minute, so a test run hours apart compares two different moments.
- **Send links the way your users paste them.** Mobile, short and tracking links included. Each endpoint's reference lists the link forms and IDs it takes.

## Measure the cost of each successful result

Failed requests are free here, so the number that matters is what you paid divided by the results you can use, not by the requests you sent.

- **Read what each answer cost** in `meta.credits_charged`, or the `x-credits-charged` header, and add them up. A retry after a failure adds nothing.
- **An empty answer that succeeds is charged**, such as a search with no results. Count it as a request, not a result.
- **Convert credits to money** with the price per credit of the plan or pack you would buy, on the [pricing page](https://socialtap.dev/pricing/index.md).

## Read null as unknown, never as zero

- **`null` means the platform doesn't show the value.** Another API's `0` for the same field is not more data. Compare a field only where both answers know it, and count how often each one knows it.
- **`approximate_fields`** lists the values the platform rounded or showed as display text ("1.5M"). Compare those with a tolerance.
- **`unknown_fields`** lists the lists whose `[]` means unknown, not none.

The [Requests guide](https://socialtap.dev/docs/requests/index.md#null-means-unknown-never-zero) has every rule.

## Compare the full answer

A REST answer has every field of the schema. An MCP tool's result is concise: it leaves out `null` fields and empty objects. Pass `detail="full"` to a tool for every field, so you compare the same answer another API sends whole.

## Leave caching out while you measure

`max_age` accepts a stored answer up to that many seconds old, and a cache hit is free, with `meta.is_cached` true. Leave it out while you measure, so every answer is read live. Add it in production, where a free repeat is what you want.

## Compare lists by the item

A list is priced per page. A smaller `limit` costs the same per page, so leave it out. Walk the same number of pages on each API and divide what you paid by the items you got. A page with `page.has_more` true and no items is not the end of the list: the [Pagination guide](https://socialtap.dev/docs/pagination/index.md) says why.

## Time requests on your side

Time each request from the same machine for every vendor, with the same inputs, at the same time of day. The first request for an item reads the platform; a repeat with `max_age` can come from the cache, much faster, so keep cached answers out of a speed test.

## Keep the request ID of anything odd

A success carries `meta.request_id`, an error `error.request_id`, and both the `x-request-id` header. When an answer looks wrong, send the ID and what you expected to [support](mailto:support@socialtap.dev): we can see that exact request.

## Common pitfalls

| Pitfall | Do this instead |
| --- | --- |
| Scoring another API's `0` higher than a `null` | Compare a field only where both answers know it |
| Comparing a concise MCP result with a full answer | Pass `detail="full"` |
| Counting failed requests in the cost | Add up `meta.credits_charged`: failures add nothing |
| Leaving `max_age` set | Leave it out while you measure: cache hits are free and fast |
| Lowering `limit` to save | Leave it out: a page costs the same at any size |
| Typing an input differently per vendor | Send the same string to each |
| Reading rounded values as exact | Check `approximate_fields` |
| Testing only inputs that work | Include a deleted post and a private account, and compare the error codes: [`not_found`](https://socialtap.dev/docs/errors/index.md#not_found) and [`private_or_unavailable`](https://socialtap.dev/docs/errors/index.md#private_or_unavailable) here |

## A comparison script

The script finds the endpoint for each need with `find_endpoint` and calls it with your inputs. It prints one line per answer: whether it succeeded, the error code, the credits it cost and the seconds it took. It uses the Python SDK (`pip install socialtap`) and its agent tools, which call the MCP server's tools, and reads the key from `SOCIALTAP_API_KEY`.

Python:

```python
import json, time
from socialtap import SocialTap
from socialtap.tools import call_tool

client = SocialTap()
# Each need in plain words, and the inputs you also send every other vendor.
TESTS = [
    ("<your need, in plain words>", [{"<param>": "<your link, handle or search>"}]),
]

for need, inputs in TESTS:
    match = call_tool(client, "find_endpoint", {"query": need, "limit": 1}).output["results"][0]
    for args in inputs:
        started = time.monotonic()
        r = call_tool(client, match["tool"], {**match["arguments"], **args, "detail": "full"})
        print(json.dumps({
            "need": need,
            "endpoint": match["endpoint"],
            "input": args,
            "ok": not r.is_error,
            "error": r.output["error"]["code"] if r.is_error else None,
            "credits": r.output.get("credits_charged", 0),
            "seconds": round(time.monotonic() - started, 2),
        }))
```

`match["params"]` names the parameters the endpoint takes, and `match["example_arguments"]` shows the kind of input each one wants.

---

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