Overview
The Nostr Profiles API provides access to user profile data from the Nostr network. All endpoints return JSON responses and support CORS for cross-origin requests.
Base URL
https://profilestr.com/api
Rate Limiting
100 requests per minute per IP
Response Format
All responses are JSON
CORS
Enabled for all origins
Authentication
Currently, the API is public and does not require authentication. All endpoints are accessible without API keys.
Future Plans
API key authentication may be added in the future for higher rate limits and additional features.
Endpoints
/api/users
Retrieve a list of users with optional filtering and pagination.
Query Parameters
pubkey
Filter by public key (partial match)name
Filter by name (partial match)displayName
Filter by display name (partial match)limit
Number of results (1-100, default: 10)offset
Number of results to skip (default: 0)Example Request
GET /api/users?name=alice&limit=5&offset=10
/api/users/:pubkey
Retrieve a specific user by their public key (hex or npub format).
Path Parameters
pubkey
User's public key (hex or npub format)Example Request
GET /api/users/npub1abc123...
/api/users/random
Retrieve a random selection of users from the database. Perfect for discovery and showcasing diverse profiles.
Query Parameters
limit
Number of random users to return (1-50, default: 10)includeNpub
Include npub format in response (true/false, default: false)Example Request
GET /api/users/random?limit=10&includeNpub=true
/api/users/:displayName
Search for users by their display name. Perfect for autocomplete functionality with intelligent matching and relevance scoring.
Path Parameters
displayName
Display name or name to search forQuery Parameters
limit
Number of results to return (1-50, default: 10)exact
Exact match only (true/false, default: false)includeNpub
Include npub format in response (true/false, default: true)Example Requests
GET /api/users/fiatjaf
GET /api/users/jack?limit=5&exact=true
Data Types
User Object
id
string (UUID)
pubkey
string (hex)
name
string | null
displayName
string | null
about
string | null
picture
string | null
nip05
string | null
lud16
string | null
followersCount
number
followsCount
number
noteCount
number
zapCount
number
Interactive API Testers
Test Random Users API
/api/users/random
Get a random selection of users from the database
Parameters
Number of users to return (1-50)
Include npub format in response
Test Display Name Search API
/api/users/fiatjaf
Search for users by display name with autocomplete functionality
Parameters
Number of results to return (1-50)
Exact match only
Include npub format in response
Note: Change "fiatjaf" in the endpoint URL above to test different display names.
Examples
Get Random Users
curl "https://profilestr.com/api/users/random?limit=10&includeNpub=true"
Returns 10 random users with npub format included
Search Users by Display Name
curl "https://profilestr.com/api/users/fiatjaf?limit=5"
Search for users with "fiatjaf" in their display name or name, perfect for autocomplete
Get Top Users
curl "https://profilestr.com/api/users?minFollowers=100&limit=10&sortBy=followers&sortOrder=desc"
Returns the top 10 users with at least 100 followers, sorted by follower count
Search Users by Name
curl "https://profilestr.com/api/users?name=alice&limit=5"
Search for users with "alice" in their name
Search Users by Multiple Criteria
curl "https://profilestr.com/api/users?name=alice&displayName=developer&minFollowers=50"
Search for users with "alice" in name, "developer" in display name, and at least 50 followers
Get Specific User
curl "https://profilestr.com/api/users/npub1abc123..."
Get a specific user by their npub
Error Handling
400 Bad Request
Invalid query parameters or malformed request
{ "error": "Invalid query parameters" }
404 Not Found
User not found or endpoint doesn't exist
{ "error": "User not found" }
500 Internal Server Error
Server error or database connection issue
{ "error": "Internal server error" }