> ## Documentation Index
> Fetch the complete documentation index at: https://getanyapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit Avatar

> Sell reddit.avatar on AnyAPI: the request your endpoint receives, the response it must return, and what the live trial grades.

Get a Reddit user's profile picture URL, karma, and account age by username. The cheapest Reddit user lookup; use reddit.profile for bio, trophies, and post and comment counts.

This page is the seller-facing summary of one catalog API, `reddit.avatar`. The transport rules that apply to every API a seller serves - signed requests, the response envelope, timeouts, and body limits - are on [the operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md).

## The price you compete with

AnyAPI publishes this API from **\$0.38 per 1,000 requests**. That is the price a buyer sees today, so it is the price your endpoint has to come in under to win traffic.

## The request your endpoint receives

| Field | Type | Required | What it means |
| - | - | - | - |
| `username` | string | yes | Reddit username, without the u/ prefix. Example: "spez". |

> **Full input JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/reddit.avatar.input.json",
>   "example": {
>     "username": "spez"
>   },
>   "title": "Reddit avatar input",
>   "type": "object",
>   "additionalProperties": false,
>   "x-aliases": {
>     "handle": "username"
>   },
>   "required": [
>     "username"
>   ],
>   "properties": {
>     "username": {
>       "type": "string",
>       "minLength": 1,
>       "description": "Reddit username, without the u/ prefix. Example: \"spez\"."
>     }
>   }
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | The user record, or null when nothing was found. |
| `data.avatarUrl` | string | no | URL of the profile avatar image, with sizing and signing query params stripped. |
| `data.commentKarma` | integer | no | Karma earned from comments. |
| `data.createdUtc` | number | no | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| `data.id` | string | yes | Reddit account ID (base-36, without the t2\_ prefix). |
| `data.karma` | integer | no | Total karma across the account, as Reddit reports it. The postKarma and commentKarma fields below are the split it is composed of. |
| `data.postKarma` | integer | no | Karma earned from posts. |
| `data.profileUrl` | string | no | Absolute reddit.com URL of the profile page. |
| `data.username` | string | yes | Account username, without the u/ prefix. |
| `found` | boolean | yes | True when the account was found; false when the lookup returned nothing. |

Extra fields are kept, missing declared fields fail.

> **Full output JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/reddit.avatar.output.json",
>   "title": "Reddit avatar output",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean",
>       "description": "True when the account was found; false when the lookup returned nothing."
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "required": [
>             "id",
>             "username"
>           ],
>           "properties": {
>             "id": {
>               "x-anyapi-must-populate": true,
>               "type": "string",
>               "description": "Reddit account ID (base-36, without the t2_ prefix)."
>             },
>             "username": {
>               "x-anyapi-must-populate": true,
>               "type": "string",
>               "description": "Account username, without the u/ prefix."
>             },
>             "avatarUrl": {
>               "x-anyapi-must-populate": true,
>               "type": "string",
>               "format": "uri",
>               "description": "URL of the profile avatar image, with sizing and signing query params stripped."
>             },
>             "profileUrl": {
>               "x-anyapi-must-populate": true,
>               "type": "string",
>               "format": "uri",
>               "description": "Absolute reddit.com URL of the profile page."
>             },
>             "createdUtc": {
>               "x-anyapi-must-populate": true,
>               "type": "number",
>               "description": "UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds."
>             },
>             "karma": {
>               "x-anyapi-must-populate": true,
>               "type": "integer",
>               "description": "Total karma across the account, as Reddit reports it. The postKarma and commentKarma fields below are the split it is composed of."
>             },
>             "postKarma": {
>               "x-anyapi-must-populate": true,
>               "type": "integer",
>               "description": "Karma earned from posts."
>             },
>             "commentKarma": {
>               "x-anyapi-must-populate": true,
>               "type": "integer",
>               "description": "Karma earned from comments."
>             }
>           }
>         }
>       ],
>       "description": "The user record, or null when nothing was found."
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `avatarUrl`
* `commentKarma`
* `createdUtc`
* `id`
* `karma`
* `postKarma`
* `profileUrl`
* `username`

The repository marks these fields as ones every source must be able to fill. An empty value is only correct when the entity itself genuinely has nothing there.

## Not found, and how it differs from empty

When the entity does not exist, answer 2xx with the not-found shape:

```json theme={"dark"}
{
  "found": false,
  "data": null
}
```

An empty result is not a not-found: when the entity exists but carries nothing, answer 2xx with `found: true` and the empty values.

This output schema declares no `reason` field, so `found: false` is the whole not-found answer.

## Example request

```json theme={"dark"}
{
  "username": "spez"
}
```

The compatibility checks fire the schema's example at your endpoint. After that, your answers are graded against what the currently serving source returned for the same real customer inputs.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the live trial.
* [Every API open to sellers](https://getanyapi.com/docs/sell/apis/index.md).
* Want to sell an API that is not on that list? Email [support@getanyapi.com](mailto:support@getanyapi.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.