# 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/comments` — The comment thread on a post

**Parameters:**
- `post_id` (query, required, string) — Numeric post id (from /v1/posts) Example: `115819`
- `sort` (query, optional, string) — Hot (default), Top, New or Old Example: `Hot`
- `limit` (query, optional, string) — Max comments (1-100) Example: `25`

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

**Response:**
```json
{
    "data": {
        "sort": "Hot",
        "count": 0,
        "source": "PieFed",
        "post_id": 115819,
        "comments": []
    },
    "meta": {
        "timestamp": "2026-06-13T14:04:21.372Z",
        "request_id": "219e3621-a212-4dfb-a667-26dc863f5780"
    },
    "status": "ok",
    "message": "Comments retrieved successfully",
    "success": true
}
```

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

**Parameters:**
- `id` (query, required, string) — Numeric post id (from /v1/posts) 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

**Parameters:**
- `sort` (query, optional, string) — Hot (default), New, Active, TopAll, TopMonth, TopWeek or TopDay Example: `Hot`
- `limit` (query, optional, string) — Max posts (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's 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 ranked, with counts

**Parameters:**
- `sort` (query, optional, string) — Active (default), Hot, New, TopAll, TopMonth or TopWeek Example: `Active`
- `limit` (query, optional, string) — Max communities (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)
```

#### `GET /v1/community` — One community in full by name or id, with moderators

**Parameters:**
- `name` (query, required, string) — Community name (or pass id=) Example: `technology`
- `id` (query, optional, string) — Numeric community id (alternative to name)

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

**Response:**
```json
{
    "data": {
        "id": 5803,
        "url": "https://piefed.social/c/technology",
        "name": "technology",
        "nsfw": false,
        "posts": 1624,
        "title": "Technology",
        "source": "PieFed",
        "comments": null,
        "instance": "piefed.social",
        "published": "2025-05-24",
        "moderators": [
            "rimu"
        ],
        "description": "Tech related news and discussion. Link to anything, it doesn't need to be a news article.  \r\n\r\nLet's keep the politics and business side of things to a minimum.  \r\n\r\n## Rules  \r\n\r\nNo memes",
        "subscribers": 2638,
        "active_users_month": null
    },
    "meta": {
        "timestamp": "2026-06-13T14:04:31.692Z",
        "request_id": "c3e2f214-71fc-4337-bfa9-5451b58835f0"
    },
    "status": "ok",
    "message": "Community retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "PieFed public API (live, SFW feeds)",
        "service": "piefed-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/post": "A single post in full (id=115819).",
            "GET /v1/user": "A member's profile (username=rimu).",
            "GET /v1/posts": "The post feed with scores and comments (sort=Hot|New|TopAll, limit).",
            "GET /v1/search": "Search communities, posts or users (q=linux, type=communities|posts|users).",
            "GET /v1/comments": "The comment thread on a post, with scores and authors (post_id=115819).",
            "GET /v1/community": "One community in full by name or id, with moderators (name=technology).",
            "GET /v1/communities": "Communities with subscriber/post/comment counts (sort=Active|Hot|TopAll, limit)."
        },
        "description": "Live community, post and user data from PieFed, an open-source threadiverse platform (a federated Reddit-style link aggregator), via the flagship piefed.social instance's public API. The communities endpoint lists communities with their subscriber, post and comment counts; the posts endpoint returns the feed with each post's title, link, score, vote and comment counts, author and community; the post endpoint returns a single post in full; the user endpoint returns a member's profile with post and comment counts and join date. Live, no key, nothing stored; to keep results work-safe, NSFW posts and communitie
…(truncated, see openapi.json for full schema)
```

### Search

#### `GET /v1/search` — Search communities, posts or users

**Parameters:**
- `q` (query, required, string) — Search query Example: `linux`
- `type` (query, optional, string) — communities (default), posts or users Example: `communities`
- `limit` (query, optional, string) — Max results (1-50) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/piefed-api/v1/search?q=linux&type=communities&limit=20"
```

**Response:**
```json
{
    "data": {
        "type": "communities",
        "count": 20,
        "query": "linux",
        "source": "PieFed",
        "results": [
            {
                "id": 232,
                "name": "linux",
                "nsfw": false,
                "posts": 6085,
                "title": "Linux",
                "comments": null,
                "published": "2019-06-01",
                "subscribers": 2295,
                "active_users_month": null
            },
            {
                "id": 2291,
                "name": "linux",
                "nsfw": false,
                "posts": 709,
                "title": "FediLUG Italia - il Linux User Group ufficiale del fediverso",
                "comments": null,
                "published": "2024-12-15",
                "subscribers": 21,
                "active_users_month": null
            },
            {
                "id": 268,
                "name": "linuxmemes",
                "nsfw": false,
                "posts": 300,
                "title": "linuxmemes",
                "comments": null,
                "published": "2023-06-15",
                "subscribers": 1824,
                "active_users_month": null
            },
            {
                "id": 1522,
                "name": "archlinux",
                "nsfw": false,
                "posts": 126,
                "title": "Arch Linux",
                "comments": null,
                "published": "2020-01-18",
             
…(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
