Skip to Content

Documentation

Caching

How long answers are kept, how to ask for a fresher one, and how to tell them apart.

Answers are kept for a while, and the same request within that time is free. The cache is shared, so a profile anyone read a minute ago is free for you too.

Lifetimes

Each answer is kept as long as what it holds stays current.

AnswerKept For
Live streams1 minute
Searches2 minutes
Comments5 minutes
Posts and lists10 minutes
Profiles15 minutes
Transcripts30 days

Instagram's searches are kept 5 minutes, and trending lists from 2 minutes to an hour, by how fast each one moves.

Ask for a Fresher Answer

Every endpoint takes maxAge, the oldest answer you accept, in seconds. A cached answer older than that is read again from the platform and charged, and maxAge=0 always reads it again. It can only shorten a lifetime, never extend it.

import { SocialAPI } from "@socialapihq/sdk";

const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });

const { data } = await client.tiktok.profile({ handle: "nike", maxAge: 60 });

Cached or Fresh

Every answer says in its headers whether it came from the cache.

HeaderCachedFresh
X-CacheHITMISS
X-Cache-AgeIts ageNot sent
X-Credits-Charged0The cost