Skip to main content

Quick Start

Get up and running with the PMF API immediately

Make Your First API Call

Test the API with a simple request - no key needed:

curl -X GET "https://api.pmf.finance/api/v1/groups/"

You should see a list of available PMF groups:

{
"groups": [
{
"id": "group_123",
"title": "2024 Election Portfolio",
"current_nav": 105.42,
"24h_change": 2.3,
"markets_count": 12
},
// ... more groups
]
}

Explore the API

Now that you're connected, explore what you can do:

Get Group Details

curl -X GET "https://api.pmf.finance/api/v1/groups/{group_id}"

Get Portfolio NAV History

# Get last 7 days with daily data points (fast - uses cache)
curl -X GET "https://api.pmf.finance/api/v1/groups/{group_id}/nav-history?interval=1w&fidelity=1440"

Get NAV Latest

curl -X GET "https://api.pmf.finance/api/v1/groups/{group_id}/nav-latest"

Current Rate Limits

All requests are automatically subject to free tier limits:

  • 60 requests per minute
  • 1,000 requests per day
  • 20,000 requests per month

Rate limit information is included in response headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1738438920

Example: Track Portfolio Performance

Here's a complete example that tracks a portfolio's NAV over time:

import requests
import json

# No API key needed!
BASE_URL = 'https://api.pmf.finance/api/v1'

# Get all groups
response = requests.get(f'{BASE_URL}/groups/')
groups = response.json()['groups']

# Pick a group and get its NAV history
group_id = groups[0]['id']

# Get last 30 days of daily NAV data (uses fast cache)
nav_response = requests.get(
f'{BASE_URL}/groups/{group_id}/nav-history',
params={'interval': '30d', 'fidelity': 1440}
)

nav_data = nav_response.json()
print(f"Portfolio: {nav_data['title']}")
print(f"Data points: {nav_data['metadata']['data_points']}")
print(f"Cache hit: {nav_data['metadata']['data_source'] == 'cache'}")

# Display NAV changes
for point in nav_data['history'][-5:]: # Last 5 days
print(f"NAV: ${point['p']:.2f}")

JavaScript Example

// No API key needed!
const BASE_URL = 'https://api.pmf.finance/api/v1';

// Get groups
fetch(`${BASE_URL}/groups/`)
.then(res => res.json())
.then(data => {
data.groups.forEach(group => {
console.log(`${group.title}: $${group.current_nav}`);
});
});

// Get NAV history for a specific group
async function getPortfolioHistory(groupId) {
const response = await fetch(
`${BASE_URL}/groups/${groupId}/nav-history?interval=7d&fidelity=1440`
);

const data = await response.json();

// Check if data came from cache (fast) or real-time (slower)
console.log('Data source:', data.metadata.data_source);
console.log('Response time:', data.metadata.response_time_ms, 'ms');

return data.history;
}

Performance Tips

  1. Use daily fidelity for historical data: fidelity=1440 gives you cached data (fast)
  2. Check the data_source field: cache = fast, real_time = slower
  3. Monitor rate limits: Check X-RateLimit-Remaining header
  4. Batch requests efficiently: Use appropriate intervals to minimize API calls

Next Steps

Need Help?