# PieFed API
> Live community, post and user data from PieFed, an open-source threadiverse platform — a federated Reddit-style link aggregator in the fediverse — via the flagship piefed.social instance's public API. PieFed is organised into communities people subscribe to, where they post links and discussions that others up- and down-vote. List the platform's communities with their subscriber, post and comment counts. Get the feed of posts with each one's title, link, score, vote and comment counts, author and community. Read a single post in full. Read a member's profile with their post and comment counts and join date. Live, no key, nothing stored; to keep results work-safe, NSFW posts and communities are filtered out of the feeds. Distinct from Lemmy, Mbin and other aggregator APIs — this is the PieFed platform, its communities, posts and members. Perfect for social-reader, fediverse and community apps.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/piefed-api/..."
```

## Pricing
- **Free** (Free) — 14,000 calls/Mo, 3 req/s
- **Starter** ($6/Mo) — 182,000 calls/Mo, 8 req/s
- **Pro** ($17/Mo) — 955,000 calls/Mo, 18 req/s
- **Business** ($40/Mo) — 5,550,000 calls/Mo, 35 req/s

## Endpoints

### Posts

#### `GET /v1/post` — A single post in full

**Parameters:**
- `id` (query, required, string) — PieFed post id Example: `115819`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/post?id=115819"
```

**Response:**
```json
{
    "data": {
        "id": 115819,
        "url": "https://x.com/TheNotesOfJosh/status/1791627871519174697",
        "body": null,
        "nsfw": false,
        "score": 355,
        "title": "To my fellow Android custom ROM enthusiasts, I highly advise you uninstall and stop supporting  @projectelixiros",
        "author": "Welp_im_damned",
        "source": "PieFed",
        "upvotes": 359,
        "comments": 32,
        "community": "android",
        "downvotes": 4,
        "published": "2024-05-18T17:41:39.597945Z",
        "community_title": "Android"
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:07.620Z",
        "request_id": "565db3ac-4353-43a6-9fec-c95955cae7db"
    },
    "status": "ok",
    "message": "Post retrieved successfully",
    "success": true
}
```

#### `GET /v1/posts` — The post feed with scores

**Parameters:**
- `sort` (query, optional, string) — Hot, New, TopAll, TopWeek Example: `Hot`
- `limit` (query, optional, string) — Max 1-100 Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/posts?sort=Hot&limit=25"
```

**Response:**
```json
{
    "data": {
        "sort": "Hot",
        "count": 25,
        "posts": [
            {
                "id": 2128939,
                "url": "https://crazypeople.online/pictrs/image/536d10e7-d8a0-4345-ae71-8e912842442b.webp",
                "nsfw": false,
                "score": 88,
                "title": "What do rule like?",
                "author": "toomanypancakes",
                "upvotes": 88,
                "comments": 3,
                "community": "onehundredninetysix",
                "downvotes": 0,
                "published": "2026-06-10T12:51:41.848720Z",
                "community_title": "196"
            },
            {
                "id": 2128907,
                "url": "https://lemmy.world/pictrs/image/e00aabe8-bd11-4e5a-85c9-725527db8e39.jpeg",
                "nsfw": false,
                "score": 78,
                "title": "It was worth a shot",
                "author": "The_Picard_Maneuver",
                "upvotes": 78,
                "comments": 1,
                "community": "comicstrips",
                "downvotes": 0,
                "published": "2026-06-10T12:42:01.808508Z",
                "community_title": "Comic Strips"
            },
            {
                "id": 2128861,
                "url": "https://media.piefed.zip/posts/EW/0k/EW0kUYHTPnqbLnL.jpg",
                "nsfw": false,
                "score": 139,
                "title": "Anyone objecting",
                "author": "RmDebArc_5",
              
…(truncated, see openapi.json for full schema)
```

### Members

#### `GET /v1/user` — A member profile

**Parameters:**
- `username` (query, required, string) — PieFed username Example: `rimu`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/user?username=rimu"
```

**Response:**
```json
{
    "data": {
        "bot": false,
        "about": "Web developer. Lead developer of [PieFed](https://join.piefed.social)",
        "posts": 860,
        "source": "PieFed",
        "comments": 2175,
        "username": "rimu",
        "published": "2024-01-04",
        "display_name": "Rimu"
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:11.750Z",
        "request_id": "3cc5ff31-f04b-4f3d-96e1-cee280c6a8fb"
    },
    "status": "ok",
    "message": "User retrieved successfully",
    "success": true
}
```

### Communities

#### `GET /v1/communities` — Communities with counts

**Parameters:**
- `sort` (query, optional, string) — Active, Hot, New, TopAll Example: `Active`
- `limit` (query, optional, string) — Max 1-100 Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/communities?sort=Active&limit=25"
```

**Response:**
```json
{
    "data": {
        "sort": "Active",
        "count": 25,
        "source": "PieFed",
        "communities": [
            {
                "id": 241,
                "name": "privacy",
                "nsfw": false,
                "posts": 3316,
                "title": "Privacy",
                "comments": null,
                "published": "2019-11-15",
                "subscribers": 1909,
                "active_users_month": null
            },
            {
                "id": 864,
                "name": "politicalmemes",
                "nsfw": false,
                "posts": 3516,
                "title": "Political Memes",
                "comments": null,
                "published": "2023-06-09",
                "subscribers": 1582,
                "active_users_month": null
            },
            {
                "id": 828,
                "name": "enoughmuskspam",
                "nsfw": false,
                "posts": 620,
                "title": "Enough Musk Spam",
                "comments": null,
                "published": "2023-06-23",
                "subscribers": 57,
                "active_users_month": null
            },
            {
                "id": 39,
                "name": "politics",
                "nsfw": false,
                "posts": 25509,
                "title": "politics",
                "comments": null,
                "published": "2023-06-09",
                "subscribers": 1011,
                "active_user
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/piefed-api
OpenAPI spec: https://www.oanor.com/api/piefed-api/openapi.json
