# API credits: cost per endpoint (https://snitchfeed.com/docs/api/credits)

API calls draw from the same **organization credit pool** as the rest of SnitchFeed. Only successful `POST /v1/data/*` calls cost credits:

| Endpoint | Credits |
| -------- | -------: |
| `POST /v1/data/twitter/tweets/search` | **{CREDIT_COSTS.API_TWITTER}** per successful request |
| `POST /v1/data/linkedin/posts/search` | **{CREDIT_COSTS.API_LINKEDIN}** per successful request |
| `POST /v1/data/linkedin/company/get` | **{CREDIT_COSTS.API_LINKEDIN}** per successful request |
| `POST /v1/data/linkedin/person/posts` | **{CREDIT_COSTS.API_LINKEDIN_PERSON_POSTS}** per successful request (one page) |
| `POST /v1/data/linkedin/person/comments` | **{CREDIT_COSTS.API_LINKEDIN_PERSON_COMMENTS}** per successful request (one page) |
| `POST /v1/data/linkedin/posts/comments` | **{CREDIT_COSTS.LINKEDIN_POST_COMMENTS}** per comment returned (minimum **{CREDIT_COSTS.LINKEDIN_POST_ENGAGEMENT_MIN}** per request; free if no comments are returned) |
| `POST /v1/data/linkedin/posts/reactions` | **{CREDIT_COSTS.LINKEDIN_POST_REACTIONS}** per reaction returned (minimum **{CREDIT_COSTS.LINKEDIN_POST_ENGAGEMENT_MIN}** per request; free if no reactions are returned) |
| `POST /v1/data/hackernews/search` | **{CREDIT_COSTS.API_HACKERNEWS}** per successful request |

Successful LinkedIn search, person posts and person comments responses return the **full page**. The optional `count` field on those endpoints is ignored.

`POST /v1/data/linkedin/person/comments` returns comments **written by** a person (profile URL). `POST /v1/data/linkedin/posts/comments` scrapes comments **on** a post (post URL).

Every other v1 endpoint is free: `GET /v1/data/linkedin/industries`, and all `/v1/mentions`, `/v1/listeners`, `/v1/feeds` and `/v1/organization/*` endpoints.

<Callout type="info">Failed requests are not charged. When a search fails after credits were set aside, they are refunded.</Callout>

## When you run out of credits [#when-you-run-out-of-credits]

Before a search runs, SnitchFeed sets aside its cost. If your organization does not have enough credits, the request fails without charging you, but the response differs by endpoint:

| Endpoint | Response |
| -------- | -------- |
| `POST /v1/data/twitter/tweets/search`, `POST /v1/data/hackernews/search` | `502 upstream_error`. The message says how many credits you need |
| `POST /v1/data/linkedin/posts/search`, `/company/get`, `/person/posts`, `/person/comments` | `502 upstream_error` with a general "could not be completed" message that does not mention credits |
| `POST /v1/data/linkedin/posts/comments`, `/posts/reactions` | `400 validation_error` with an issue on `credits`. These scrapes set aside credits for the maximum you asked for (`maxComments` or `maxReactions`), so lowering it can help |

If a LinkedIn call returns `502` and you are unsure why, check your balance with `GET /v1/organization/usage` (needs `org:read`).

## Check usage [#check-usage]

- `GET /v1/organization/usage` returns credit usage for the current billing period.
- In the app, **Integrations → API → Usage** lists recent API requests, and the [credits page](/docs/credits) explains usage across the product.

## OpenAPI [#openapi]

`GET /v1/openapi.json` includes `components.schemas.SnitchFeedCreditRates` for code generators. It covers the X, LinkedIn search and company, LinkedIn person, and LinkedIn comment and reaction rates, but not the Hacker News rate. Use the table above for Hacker News.

## Related [#related]

- [Credits and usage](/docs/credits): how credits work across listeners, exports and chat
- [API rate limits](/docs/api/rate-limits): per-minute and in-flight limits
- [API scopes](/docs/api/scopes): `search:read` controls who can spend credits
- [SnitchFeed API](/docs/api/introduction): endpoints and error codes
