Migrating to v2
v2 lives at https://api.spyglass.so/v2. Same keys, same credits, same
error envelope. v1 still responds at /api/v1, but these docs cover v2 only.
Endpoint map
Search
- No more
modeortype. The endpoint decides brand or creator, and the inputs decide how to search. Precedence isids>igUsername/tiktokUsername>names>query. brandNamesis nownames.brandIdsis nowids.- Username search. Pass
igUsernameortiktokUsernameto find accounts whose handle contains that text. - Different filters.
/brandsdoesn’t acceptgender,ageRange,ethnicityorlanguage;/creatorsdoes. Both acceptlocation. Sending them to/brandsis a400. - Different output. Every row has a
type. Creators return profile fields (gender,ageRange,ethnicity,location,language,tiktokEngagementRate) and omitfacebookUsername,likesandcategory. countis nowlimit. The request field that caps rows islimit, same as/media. Responses still reportcount, the number of rows returned.sortByis no longer rejected when you search byquery; it is ignored.
Account lookup
GET /account/{id} returns either a brand or a creator. Branch on type.
Media
/mediatakes an optionalaccountIdin the body. Omit it to search the whole corpus, in which casequeryis required.- v1’s
semanticSearchQueryisqueryin v2 (same creative search semantics). - Filters are flat. v1’s
filtersobject is gone: putchannel,format,status,sortBy,limitand the rest at the top level of the body. The nested ranges are flattened too:
userRequestis no longer accepted.- Unknown fields return
400 invalid_request. taxonomyon/mediaand/brandstakes path strings fromGET /taxonomies(for exampleApparel > Footwear > Sneakers). That lookup is free.