newOS for Developers

Back to Lists & Rankings

Public Posts

Global feed of public content

beginnerGET /post/list/public

Overview

Public Posts returns a chronological feed of all publicly visible posts. This is the main discovery endpoint for browsing content without following anyone.

Unlike user-specific feeds, this shows content from the entire network.

API Endpoint

GET/post/list/public

Query Parameters:

  • orderBy — Sort field: "created", "watts", "updated"
  • direction — "asc" or "desc"
  • contentType — Filter: "image", "video", "text"
  • page — Pagination cursor

Usage Example

import { getPublicPosts } from "@newgraph-signals/actions/post";

// Get latest public posts
const feed = getPublicPosts({
  orderBy: "created",
  direction: "desc"
});

// Filter to images only
const images = getPublicPosts({
  contentType: "image",
  orderBy: "watts",
  direction: "desc"
});

// Raw API call with pagination
const response = await newgraphClient.api.post.listPublic({
  query: {
    page: "0",
    orderBy: "created",
    direction: "desc"
  }
});

Response Schema

// PagedResponse<PostReadResponse>
{
  value: [
    {
      id: string;
      title: string;
      description: string;
      contentUrl: string;
      contentType: string;
      author: {
        id: string;
        username: string;
        displayName: string;
        contentUrl: string;  // Avatar
      };
      folder: {
        id: string;
        title: string;
      };
      created: string;
      watts: number;
      tags: string[];
    }
  ],
  done: boolean;
  page: string;
}