> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.spyglass.so/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.spyglass.so/_mcp/server.

# Finding media

> Resolve an account, search the index, and fetch live posts when the account is not indexed.

There are two ways to get an account's posts. Check the index first. Fetch live posts when the account is not there.

## `POST /media` and `GET /account/posts`

|                         | [`POST /media`](/api-reference/spyglass-api/search/search-media) | [`GET /account/posts`](/api-reference/spyglass-api/social-media-account/posts) |
| ----------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| What it reads           | Posts already in the Spyglass index                              | Posts fetched and processed during the request                                 |
| Account must be indexed | Yes                                                              | No. A handle or Facebook Ad Library id is enough                               |
| How long it takes       | Typically under 10 seconds                                       | About 10–30 seconds. Longer when `limit` spans more than one source page       |
| What you pass           | `accountId` from search, or a `query` across the index           | Exactly one of `igUsername`, `tiktokUsername`, or `facebookAdLibraryId`        |
| `limit`                 | Default 100, max 2000                                            | Default 20, max 120                                                            |
| Price                   | 1 credit per creative, minimum 1                                 | 1 credit per post, minimum 1                                                   |

`POST /media` is the path for creatives Spyglass has already processed: hooks, categories, and performance are on the rows. `GET /account/posts` is the path when you know the account and it is not in the index yet. Both charge 1 credit per row returned. A call that returns no posts still costs 1 credit.

## Resolve the account, then search the index

1. Resolve the account with [`POST /brands`](/api-reference/spyglass-api/search/search-brands) or [`POST /creators`](/api-reference/spyglass-api/search/search-creators). Pass a name, handle, or short query. If you already have a platform id or handle, [`GET /account/{id}`](/api-reference/spyglass-api/social-media-account/get) reads that account directly.
2. Pass the returned `id` as `accountId` to `POST /media`. Omit `query` when you want that account's library. Add `query` only when you want one theme inside that account.
3. If search returns no account, or `POST /media` has no rows for it, and you know the Instagram handle, TikTok handle, or Facebook Ad Library page id, call `GET /account/posts`.

A topic search skips the account step. `POST /media` with `query` and no `accountId` searches the whole index.

## Live posts

`GET /account/posts` does not require the brand to be indexed. Spyglass fetches the posts from Instagram, TikTok, or the Facebook Ad Library and processes them on the request. Plan for about 10–30 seconds. For Instagram, `postType` is `posts` (default) or `reels`. `reels` cannot be combined with `tagged=true`.

The same request starts indexing the rest of the brand's posts. Once that finishes, later lookups can use `POST /media` and come back faster.

A `limit` above one source page takes longer, because each page is a separate fetch:

| Source                           | Posts per source page |
| -------------------------------- | --------------------- |
| Instagram                        | 12                    |
| Instagram tagged (`tagged=true`) | up to 10              |
| TikTok                           | 10                    |
| Facebook Ad Library              | 30                    |

`limit` defaults to 20 and maxes at 120. Sort and identifier rules are in [Conventions](/documentation/conventions/conventions#account-posts).

## When you will query the account again

A live `GET /account/posts` call already starts indexing the rest of the brand's posts. [`POST /account/index`](/api-reference/spyglass-api/social-media-account/index-account) is the explicit way to add the account when you also want insights, campaigns, and landing pages. Poll [`GET /account/{id}/index-status`](/api-reference/spyglass-api/social-media-account/index-status) until it is ready, then use `POST /media`.