> ## Documentation Index
> Fetch the complete documentation index at: https://www.dropfans.io/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/external/v1/earnings — Earnings stats, chart and recent transactions

> The same revenue the creator sees on their own dashboard: drop sales + tips + subscription payments, refunds and chargebacks excluded, bucketed by day in the caller's timezone.

- Source: https://www.dropfans.io/developers/reference/get-earnings
- Section: API reference
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Also served at `/api/external/earnings` (the unversioned alias).

The same revenue the creator sees on their own dashboard: drop sales + tips + subscription payments, refunds and chargebacks excluded, bucketed by day in the caller's timezone.

Everything here is in **cents** (the balance endpoint is dollars). `stats.totalEarningsCents` is NET (after the platform fee); `grossEarningsCents` and the chart series are seller GROSS (buyer-paid minus tax, before the fee) so per-day merges against your own gross ledgers compare like for like. Pass `tz` = the creator's timezone (read it from [GET /api/external/v1/timezone](https://www.dropfans.io/developers/reference/get-timezone.md)) or your day buckets won't match their dashboard.

> [!NOTE] transactions is a fixed cap, not a page
> `transactions` is always the newest 50 across all three sources. For the complete, paginated ledger with net / fee / VAT per transaction, use [GET /api/external/v1/earnings/transactions](https://www.dropfans.io/developers/reference/list-earnings-transactions.md).

## Authentication

`Authorization: Bearer dpfn_...` — an API key generated in the dashboard (Vault → API Connect). By default the key acts for the one account it belongs to. Missing or invalid keys return 401 `{"error":"Unauthorized","code":"unauthorized"}`.

**For a creator you manage or onboarded:** `GET /api/external/v1/creators/{creatorId}/earnings` — with a verified agency's own key for a creator or AI persona it manages, or your app owner's own key for an account your app onboarded (ids from GET /api/external/v1/creators); for a managed creator the agency needs `canViewStats`. The response echoes the account acted on in `X-Dropfans-Account`. Sending `X-Dropfans-Account: <account id>` on the plain path still works but is deprecated.

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `startDate` | string | yes | Window start, YYYY-MM-DD, interpreted in `tz`. |
| `endDate` | string | yes | Window end (inclusive), YYYY-MM-DD, interpreted in `tz`. |
| `tz` | string |  | IANA timezone for day bucketing. **Invalid values silently fall back to UTC** — no error. |

## Responses

### 200

Stats, chart and the newest transactions. All money in cents.

| Field | Type | Required | Description |
|---|---|---|---|
| `stats` | EarningsStats | yes | Window totals. Cents throughout (the balance endpoint is dollars). |
| `chart` | EarningsChart | yes | Bucketed GROSS series in the caller’s timezone. |
| `transactions` | EarningsTransaction[] | yes | The newest 50 transactions across all three sources — a fixed cap, not a page. For the complete ledger use GET /api/external/v1/earnings/transactions. |

```json
{
  "stats": {
    "totalEarningsCents": 182050,
    "grossEarningsCents": 214180,
    "previousPeriodEarningsCents": 141200,
    "previousPeriodGrossEarningsCents": 166100,
    "transactionCount": 41,
    "avgTransactionCents": 4440,
    "uniqueCustomers": 28,
    "typeTotals": {
      "drop": {
        "grossCents": 150000,
        "netCents": 127500,
        "count": 30
      },
      "tip": {
        "grossCents": 44180,
        "netCents": 37550,
        "count": 8
      },
      "subscription": {
        "grossCents": 20000,
        "netCents": 17000,
        "count": 3
      }
    }
  },
  "chart": {
    "labels": [
      "Aug 18",
      "Aug 19"
    ],
    "values": [
      12500,
      9800
    ],
    "dates": [
      "2026-08-18",
      "2026-08-19"
    ],
    "groupBy": "day",
    "typedValues": {
      "drop": [
        10000,
        7500
      ],
      "tip": [
        2500,
        2300
      ],
      "subscription": [
        0,
        0
      ]
    }
  },
  "transactions": [
    {
      "id": "clx0rd3r000001sale",
      "productId": "clxdr0p000001prod",
      "productName": "Beach set — 6 photos",
      "amountCents": 2000,
      "grossAmountCents": 2500,
      "buyerEmail": "buyer@example.com",
      "buyerName": null,
      "paidAt": "2026-08-18T21:03:00.000Z",
      "type": "drop"
    }
  ]
}
```

## Errors

| Status | Body | When |
|---|---|---|
| 400 | `{"error":"startDate and endDate query params are required (YYYY-MM-DD)"}` | Either date param is missing. |
| 401 | `{"error":"Unauthorized","code":"unauthorized"}` | Missing or invalid API key. |
| 500 | `{"error":"Failed to fetch earnings"}` | Query failed — retry later. |
| 400 | `{"error":"X-Dropfans-Account must be an account id (from GET /api/external/agency/creators), not a username.","code":"invalid_account_header"}` | `X-Dropfans-Account` is not an account id. |
| 400 | `{"error":"X-Dropfans-Account names a different account than the path — send one or the other.","code":"account_mismatch"}` | Called under /v1/creators/{creatorId}/ with an `X-Dropfans-Account` naming another account. |
| 403 | `{"error":"This key cannot act for that account.","code":"account_not_managed"}` | The creator in the path (or `X-Dropfans-Account`) is one this key cannot act for: no ACCEPTED management by your agency and not an account your app onboarded (or it no longer holds a key bound to your app), a key minted for one creator, or someone is suspended, banned or deleted. An unknown id gets the same answer. |
| 403 | `{"error":"The agency does not have permission for this on that account.","code":"permission_denied","permission":"canViewStats"}` | For a managed creator: the agency lacks `canViewStats` on that account. |
| 403 | `{"error":"This app does not have the earnings API category enabled. Contact support to enable it.","code":"api_category_disabled","category":"earnings"}` | Your app has the Earnings & balance [API category](https://www.dropfans.io/developers/concepts/api-categories.md) switched off. |

## Notes

Chart bucketing: day for spans ≤31 days, week ≤90, month beyond. `transactions[].productId` only exists on type "drop" — use it to join a sale back to the drop your app created. Because refunds are excluded here but NOT in check-status, the two can legitimately disagree.

## Rate limiting

Per-key fixed windows by tier (Personal 60/min · 5,000/day; approved apps 300/min · 50,000/day; Dropfans-operated integrations exempt). Read the live values from X-RateLimit-Tier, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and their -Day variants; a 429 carries Retry-After and `{"error":"Rate limit exceeded","code":"rate_limited"}`. See [Rate limits](https://www.dropfans.io/developers/concepts/rate-limits.md).

## Code samples

### curl

```bash
curl "https://www.dropfans.io/api/external/v1/earnings?startDate=2026-08-01&endDate=2026-08-19&tz=Europe%2FStockholm" \
  -H "Authorization: Bearer $DROPFANS_API_KEY"
```

### Node

```javascript
const res = await fetch(`https://www.dropfans.io/api/external/v1/earnings?startDate=2026-08-01&endDate=2026-08-19&tz=Europe%2FStockholm`, {
  headers: {
    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,
  },
});
console.log(await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://www.dropfans.io/api/external/v1/earnings",
    headers={"Authorization": f"Bearer {os.environ['DROPFANS_API_KEY']}"},
    params={"startDate": "2026-08-01", "endDate": "2026-08-19", "tz": "Europe/Stockholm"},
)
print(res.json())
```

## OpenAPI

```json
{
  "method": "GET",
  "path": "/api/external/v1/earnings",
  "operationId": "getEarnings",
  "tags": [
    "earnings"
  ],
  "summary": "Earnings stats, chart and recent transactions",
  "description": "The same revenue the creator sees on their own dashboard: drop sales + tips + subscription payments, refunds and chargebacks excluded, bucketed by day in the caller's timezone.\n\nEverything here is in **cents** (the balance endpoint is dollars). `stats.totalEarningsCents` is NET (after the platform fee); `grossEarningsCents` and the chart series are seller GROSS (buyer-paid minus tax, before the fee) so per-day merges against your own gross ledgers compare like for like. Pass `tz` = the creator's timezone (read it from [GET /api/external/v1/timezone](https://www.dropfans.io/developers/reference/get-timezone.md)) or your day buckets won't match their dashboard.\n\n> [!NOTE] transactions is a fixed cap, not a page\n> `transactions` is always the newest 50 across all three sources. For the complete, paginated ledger with net / fee / VAT per transaction, use [GET /api/external/v1/earnings/transactions](https://www.dropfans.io/developers/reference/list-earnings-transactions.md).",
  "parameters": [
    {
      "name": "startDate",
      "in": "query",
      "required": true,
      "description": "Window start, YYYY-MM-DD, interpreted in `tz`.",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "example": "2026-08-01"
    },
    {
      "name": "endDate",
      "in": "query",
      "required": true,
      "description": "Window end (inclusive), YYYY-MM-DD, interpreted in `tz`.",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "example": "2026-08-19"
    },
    {
      "name": "tz",
      "in": "query",
      "required": false,
      "description": "IANA timezone for day bucketing. **Invalid values silently fall back to UTC** — no error.",
      "schema": {
        "type": "string",
        "default": "UTC",
        "format": "iana-timezone"
      },
      "example": "Europe/Stockholm"
    },
    {
      "name": "X-Dropfans-Account",
      "in": "header",
      "required": false,
      "deprecated": true,
      "description": "Deprecated: call the …ForCreator operation (/api/external/v1/creators/{creatorId}/…) instead; the header keeps working and such responses carry Deprecation and Link: rel=\"successor-version\". With a verified agency’s own key, the id of a creator or AI persona the agency manages (from GET /api/external/v1/agency/creators): the request then acts as that account, exactly as if it were sent with that account’s own key. Account ids only — usernames are refused (400 invalid_account_header). Checked on every request: the management must be ACCEPTED, nobody may be suspended, banned or deleted (else 403 account_not_managed), and the agency needs the endpoint’s permission on that account (else 403 permission_denied). Omit it to act as the key’s own account.",
      "schema": {
        "type": "string",
        "pattern": "^c[a-z0-9]{20,32}$"
      },
      "example": "cmh4v2q8k0003xy9z7w6v5u4t"
    }
  ],
  "responses": {
    "200": {
      "description": "Stats, chart and the newest transactions. All money in cents.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-Dropfans-Account": {
          "description": "The id of the account this request acted on — the key’s own account, or the managed account named in the X-Dropfans-Account request header. Assert it when acting for several accounts.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "stats": {
                "type": "object",
                "properties": {
                  "totalEarningsCents": {
                    "type": "integer",
                    "description": "**NET** seller earnings in cents for the window (after platform fee).",
                    "example": 182050
                  },
                  "grossEarningsCents": {
                    "type": "integer",
                    "description": "Seller gross in cents (buyer-paid minus tax, before the platform fee) — matches the dashboard’s Gross toggle.",
                    "example": 214180
                  },
                  "previousPeriodEarningsCents": {
                    "type": "integer",
                    "description": "NET cents for the same-length window immediately before startDate."
                  },
                  "previousPeriodGrossEarningsCents": {
                    "type": "integer",
                    "description": "Gross cents for the previous window."
                  },
                  "transactionCount": {
                    "type": "integer",
                    "description": "Paid transactions in the window (drops + tips + subscription payments).",
                    "example": 41
                  },
                  "avgTransactionCents": {
                    "type": "integer",
                    "description": "Average NET cents per transaction."
                  },
                  "uniqueCustomers": {
                    "type": "integer",
                    "description": "Distinct buyer emails in the window.",
                    "example": 28
                  },
                  "typeTotals": {
                    "type": "object",
                    "properties": {
                      "drop": {
                        "type": "object",
                        "properties": {
                          "grossCents": {
                            "type": "integer",
                            "description": "Gross cents."
                          },
                          "netCents": {
                            "type": "integer",
                            "description": "Net cents."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Transaction count."
                          }
                        },
                        "required": [
                          "grossCents",
                          "netCents",
                          "count"
                        ],
                        "description": "Totals for drop revenue."
                      },
                      "tip": {
                        "type": "object",
                        "properties": {
                          "grossCents": {
                            "type": "integer",
                            "description": "Gross cents."
                          },
                          "netCents": {
                            "type": "integer",
                            "description": "Net cents."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Transaction count."
                          }
                        },
                        "required": [
                          "grossCents",
                          "netCents",
                          "count"
                        ],
                        "description": "Totals for tip revenue."
                      },
                      "subscription": {
                        "type": "object",
                        "properties": {
                          "grossCents": {
                            "type": "integer",
                            "description": "Gross cents."
                          },
                          "netCents": {
                            "type": "integer",
                            "description": "Net cents."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Transaction count."
                          }
                        },
                        "required": [
                          "grossCents",
                          "netCents",
                          "count"
                        ],
                        "description": "Totals for subscription revenue."
                      }
                    },
                    "required": [
                      "drop",
                      "tip",
                      "subscription"
                    ],
                    "description": "Per-type window totals (additive field, 2026-07-22)."
                  }
                },
                "required": [
                  "totalEarningsCents",
                  "grossEarningsCents",
                  "previousPeriodEarningsCents",
                  "previousPeriodGrossEarningsCents",
                  "transactionCount",
                  "avgTransactionCents",
                  "uniqueCustomers",
                  "typeTotals"
                ]
              },
              "chart": {
                "type": "object",
                "properties": {
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Human-readable bucket label."
                    },
                    "description": "Chart x-axis labels, aligned with `values` and `dates`."
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "description": "GROSS cents for the bucket."
                    },
                    "description": "**GROSS** cents per bucket (gross so per-day merges against your own gross ledgers compare like for like)."
                  },
                  "dates": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "YYYY-MM-DD bucket key."
                    },
                    "description": "Bucket keys in the caller’s tz. Weekly buckets use the week-start date, monthly the 1st."
                  },
                  "groupBy": {
                    "type": "string",
                    "description": "Bucket size: day when the span is ≤31 days, week ≤90, else month.",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ]
                  },
                  "typedValues": {
                    "type": "object",
                    "properties": {
                      "drop": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "description": "Gross cents."
                        },
                        "description": "Gross cents per bucket from drops."
                      },
                      "tip": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "description": "Gross cents."
                        },
                        "description": "Gross cents per bucket from tips."
                      },
                      "subscription": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "description": "Gross cents."
                        },
                        "description": "Gross cents per bucket from subscriptions."
                      }
                    },
                    "required": [
                      "drop",
                      "tip",
                      "subscription"
                    ],
                    "description": "Per-type GROSS cent series aligned 1:1 with `dates` (additive field, 2026-07-22)."
                  }
                },
                "required": [
                  "labels",
                  "values",
                  "dates",
                  "groupBy",
                  "typedValues"
                ]
              },
              "transactions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The order / tip / renewal id (source-specific — matches nothing on the buyer’s side)."
                    },
                    "productId": {
                      "type": "string",
                      "description": "The sold product’s id — **drop transactions only**; absent on tips and subscriptions. Join it back to your own drop records."
                    },
                    "productName": {
                      "type": "string",
                      "description": "Product name, or the literal \"Tip\" / \"Subscription\".",
                      "example": "Beach set — 6 photos"
                    },
                    "amountCents": {
                      "type": "integer",
                      "description": "NET seller earnings in cents.",
                      "example": 2000
                    },
                    "grossAmountCents": {
                      "type": "integer",
                      "description": "Gross cents (buyer-paid minus tax).",
                      "example": 2500
                    },
                    "buyerEmail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Buyer email when known.",
                      "format": "email"
                    },
                    "buyerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Buyer display name — tips and subscriptions only; always null on drops."
                    },
                    "paidAt": {
                      "type": "string",
                      "description": "When it was paid.",
                      "format": "date-time"
                    },
                    "type": {
                      "type": "string",
                      "description": "Revenue source.",
                      "enum": [
                        "drop",
                        "tip",
                        "subscription"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "productName",
                    "amountCents",
                    "grossAmountCents",
                    "paidAt",
                    "type"
                  ]
                },
                "description": "The newest 50 transactions across all three sources — a fixed cap, not a page. For the complete ledger use GET /api/external/v1/earnings/transactions."
              }
            },
            "required": [
              "stats",
              "chart",
              "transactions"
            ]
          },
          "example": {
            "stats": {
              "totalEarningsCents": 182050,
              "grossEarningsCents": 214180,
              "previousPeriodEarningsCents": 141200,
              "previousPeriodGrossEarningsCents": 166100,
              "transactionCount": 41,
              "avgTransactionCents": 4440,
              "uniqueCustomers": 28,
              "typeTotals": {
                "drop": {
                  "grossCents": 150000,
                  "netCents": 127500,
                  "count": 30
                },
                "tip": {
                  "grossCents": 44180,
                  "netCents": 37550,
                  "count": 8
                },
                "subscription": {
                  "grossCents": 20000,
                  "netCents": 17000,
                  "count": 3
                }
              }
            },
            "chart": {
              "labels": [
                "Aug 18",
                "Aug 19"
              ],
              "values": [
                12500,
                9800
              ],
              "dates": [
                "2026-08-18",
                "2026-08-19"
              ],
              "groupBy": "day",
              "typedValues": {
                "drop": [
                  10000,
                  7500
                ],
                "tip": [
                  2500,
                  2300
                ],
                "subscription": [
                  0,
                  0
                ]
              }
            },
            "transactions": [
              {
                "id": "clx0rd3r000001sale",
                "productId": "clxdr0p000001prod",
                "productName": "Beach set — 6 photos",
                "amountCents": 2000,
                "grossAmountCents": 2500,
                "buyerEmail": "buyer@example.com",
                "buyerName": null,
                "paidAt": "2026-08-18T21:03:00.000Z",
                "type": "drop"
              }
            ]
          }
        }
      }
    },
    "400": {
      "description": "Either date param is missing. Also: `X-Dropfans-Account` is not an account id. Also: Called under /v1/creators/{creatorId}/ with an `X-Dropfans-Account` naming another account.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "startDate and endDate query params are required (YYYY-MM-DD)"
          }
        }
      }
    },
    "401": {
      "description": "Missing or invalid API key.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Unauthorized",
            "code": "unauthorized"
          }
        }
      }
    },
    "403": {
      "description": "The creator in the path (or `X-Dropfans-Account`) is one this key cannot act for: no ACCEPTED management by your agency and not an account your app onboarded (or it no longer holds a key bound to your app), a key minted for one creator, or someone is suspended, banned or deleted. An unknown id gets the same answer. Also: For a managed creator: the agency lacks `canViewStats` on that account. Also: Your app has the Earnings & balance [API category](https://www.dropfans.io/developers/concepts/api-categories.md) switched off.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "This key cannot act for that account.",
            "code": "account_not_managed"
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded for the current minute or day window. Wait Retry-After seconds and retry.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "Retry-After": {
          "description": "Seconds to wait before retrying (sent with 429s).",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Rate limit exceeded",
            "code": "rate_limited"
          }
        }
      }
    },
    "500": {
      "description": "Query failed — retry later.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "Failed to fetch earnings"
          }
        }
      }
    }
  },
  "x-codeSamples": [
    {
      "lang": "cURL",
      "label": "curl",
      "source": "curl \"https://www.dropfans.io/api/external/v1/earnings?startDate=2026-08-01&endDate=2026-08-19&tz=Europe%2FStockholm\" \\\n  -H \"Authorization: Bearer $DROPFANS_API_KEY\""
    },
    {
      "lang": "JavaScript",
      "label": "Node",
      "source": "const res = await fetch(`https://www.dropfans.io/api/external/v1/earnings?startDate=2026-08-01&endDate=2026-08-19&tz=Europe%2FStockholm`, {\n  headers: {\n    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,\n  },\n});\nconsole.log(await res.json());"
    },
    {
      "lang": "Python",
      "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://www.dropfans.io/api/external/v1/earnings\",\n    headers={\"Authorization\": f\"Bearer {os.environ['DROPFANS_API_KEY']}\"},\n    params={\"startDate\": \"2026-08-01\", \"endDate\": \"2026-08-19\", \"tz\": \"Europe/Stockholm\"},\n)\nprint(res.json())"
    }
  ],
  "x-dropfans-docs": "https://www.dropfans.io/developers/reference/get-earnings",
  "x-dropfans-category": "earnings",
  "x-dropfans-agency-permission": "canViewStats"
}
```

---

Previous: [Delete a post (or cancel a scheduled one)](https://www.dropfans.io/developers/reference/delete-post.md) · Next: [Earnings summary: totals, sources and a day / week series](https://www.dropfans.io/developers/reference/get-earnings-summary.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
