Primal WebSocket API Fixtures

This directory contains real response fixtures captured from the Primal cache server at wss://cache.primal.net/v1.

Purpose

These fixtures serve as:
- Examples for developers integrating with Primal's API
- Test data for unit/integration tests
- Documentation showing actual response structures
- Reference for understanding event kinds and data relationships

Fixture Format

Each fixture file contains:

{
  "request": ["REQ", "<subscription_id>", {...}],
  "responses": [
    ["EVENT", "<subscription_id>", {...}],
    ["EVENT", "<subscription_id>", {...}],
    ["EOSE", "<subscription_id>"]
  ]
}

Available Fixtures

User & Profile

- user_profile.json (6.8K) - Complete user profile with metadata, stats, and membership info
- Request: user_profile cache endpoint
- Returns: Kind 0, 10000105, 10000119, 10000169, 10063

- user_infos.json (7.0K) - Batch user information
- Request: user_infos cache endpoint with pubkey array
- Returns: Kind 0, 10000108, 10000133, 10000119, 10000169, 10063

- user_followers.json (87K) - List of users who follow an account
- Request: user_followers cache endpoint
- Returns: Kind 0, 10000108, 10000119, 10000133, 10000158, 10000169, 10063

- is_user_following.json (521B) - Check if one user follows another
- Request: is_user_following cache endpoint
- Returns: Kind 10000125 with boolean string

- contact_list.json (2.1M) - User's contact/follow list
- Request: contact_list cache endpoint
- Returns: Kind 3 contact list plus metadata for all follows

- mutelist.json (1.7K) - User's mute list
- Request: mutelist cache endpoint
- Returns: Kind 10000, 0, 10000108

- user_profile_followed_by.json (56K) - Profile with "followed by" information
- Request: user_profile cache endpoint with followed_by data
- Returns: User profile with mutual follows data

Feeds & Content

- feed_authored.json (62K) - Posts authored by a user (limit 5)
- Request: feed cache with notes: "authored"
- Returns: Kind 1, 6, 9735, 0, 10000100, 10000107, 10000113, 10000128, 10000129, etc.

- feed_follows.json (245K) - Feed of posts from followed users
- Request: feed cache with notes: "follows"
- Returns: Posts from users they follow with full metadata

- thread_view.json (178K) - Conversation thread with replies
- Request: thread_view cache endpoint
- Returns: Main post, parent posts, replies, and all associated metadata

- events.json (19K) - Specific events by ID with extended metadata
- Request: events cache with extended_response: true
- Returns: Requested events plus all associated metadata

Trending & Discovery

- explore_global_trending_24h.json (1.6M) - Globally trending posts (24h)
- Request: explore_global_trending_24h cache endpoint
- Returns: Trending posts with full engagement data, zaps, media, etc.

- scored_trending_24h.json (369K) - Trending feed using scored endpoint
- Request: scored cache with selector: "trending_24h"
- Returns: Scored/trending content

- scored_mostzapped_4h.json (561K) - Most zapped posts (4h window)
- Request: scored cache with selector: "mostzapped_4h"
- Returns: Posts with highest zap amounts

- explore_zaps.json (365K) - Trending zaps across network
- Request: explore_zaps cache endpoint
- Returns: Zap events, zapped posts, user metadata

- explore_people.json (52K) - Recommended/trending users
- Request: explore_people cache endpoint
- Returns: User metadata, follower counts, scores

- explore_media.json (128K) - Trending posts with media
- Request: explore_media cache endpoint
- Returns: Posts with images/videos plus media metadata

- trending_hashtags.json (325B) - Trending hashtags
- Request: trending_hashtags cache endpoint
- Note: Returns NOTICE error - use _4h or _7d variants instead

- trending_hashtags_4h.json (6.7K) - Trending hashtags (4 hour window)
- Request: trending_hashtags_4h cache endpoint
- Returns: Kind 10000116 with hashtag scores (nostr, bitcoin, btc, etc.)

- trending_hashtags_7d.json (6.8K) - Trending hashtags (7 day window)
- Request: trending_hashtags_7d cache endpoint
- Returns: Kind 10000116 with weekly hashtag trends

Search

- user_search.json (47K) - User search results
- Request: user_search cache with query "jack"
- Returns: Matching users with Kind 0, 10000108, 10000133, 10000158

- mega_feed_directive.json (368B) - Mega feed directive endpoint
- Request: mega_feed_directive cache endpoint
- Returns: Feed configuration directives

- mega_feed_directive_search.json (93K) - Search using mega feed directive
- Request: mega_feed_directive cache with search parameters
- Returns: Search results with feed directive

Event Actions

- event_actions_likes.json (77K) - Users who liked an event
- Request: event_actions cache with kind: 7
- Returns: Kind 7 reactions plus user metadata

- event_actions_replies.json (119K) - Replies to an event
- Request: event_actions cache with kind: 1
- Returns: Kind 1 reply posts plus metadata

- event_actions_reposts.json (8.3K) - Reposts of an event
- Request: event_actions cache with kind: 6
- Returns: Kind 6 reposts plus user metadata

- event_actions_zaps.json (19K) - Zaps on an event
- Request: event_actions cache with kind: 9735
- Returns: Kind 9735 zap receipts plus Kind 10000129 zap details

Zaps & Memberships

- user_zaps.json (381B) - Zaps received by a user
- Request: user_zaps cache endpoint
- Note: Small response - limited zaps in test period

- creator_paid_tiers.json (283B) - Creator membership tiers
- Request: creator_paid_tiers cache endpoint
- Returns: Paid tier information

- membership_legends_leaderboard.json (77K) - Legends membership leaderboard
- Request: membership_legends_leaderboard cache endpoint
- Returns: Top Legends members with stats

- membership_premium_leaderboard.json (57K) - Premium membership leaderboard
- Request: membership_premium_leaderboard cache endpoint
- Returns: Top Premium members with stats

Relays & Configuration

- get_default_relays.json (472B) - Default relay recommendations
- Request: get_default_relays cache endpoint
- Returns: Kind 10000124 with array of relay URLs

Statistics

- net_stats.json (183B) - Network statistics
- Request: net_stats cache endpoint
- Note: Async endpoint, may return EOSE immediately

Test Identifiers Used

All fixtures were captured using these test identifiers:

- Pubkey 1: 0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd (Alex Gleason)
- Pubkey 2: 82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2 (jack)
- Event ID: df670a0c011959f432b63f0458202f3f985f3fd3765acc788a3276d7229d6850
- Search queries: "aliens", "jack"

Usage Examples

Load a fixture in JavaScript/TypeScript

const fixture = await fetch('https://antiprimal.net/docs/fixtures/user_profile.json')
  .then(r => r.json());

// Get the request
console.log(fixture.request);

// Process responses
fixture.responses.forEach(msg => {
const [type, subId, data] = msg;
if (type === 'EVENT') {
console.log(Event kind ${data.kind}:, data.content);
}
});

Use in tests

import userProfileFixture from './fixtures/user_profile.json';

test('parses user profile', () => {
const events = userProfileFixture.responses
.filter(msg => msg[0] === 'EVENT')
.map(msg => msg[2]);

const metadata = events.find(e => e.kind === 0);
expect(metadata).toBeDefined();
expect(JSON.parse(metadata.content)).toHaveProperty('name');
});

Captured On

All fixtures were captured on February 7, 2026 from production Primal servers.

Note: Some responses may be empty if:
- The endpoint requires authentication
- The endpoint is async and returns results later
- Rate limiting or server issues occurred during capture
- The query parameters need adjustment