This guide gets you set up with a scoped API key and walks through your first request to the BlogHunch /v1 API.
Before making requests, generate an API key in your dashboard under Settings » API. Agencies and Enterprise accounts can choose Organization-Wide keys to manage multiple client sites with a single credential.
Verify your token
GEThttps://api.bloghunch.com/v1/me
Confirm your token, granted scopes, rate limit quota, and resolved publication or organization by calling /v1/me.
GET/v1/me
curl https://api.bloghunch.com/v1/me \
-H "Authorization: Bearer {token}"const res = await fetch('https://api.bloghunch.com/v1/me', {
headers: { Authorization: `Bearer ${process.env.BLOGHUNCH_API_KEY}` },
})
const { data } = await res.json()import os, requests
res = requests.get(
'https://api.bloghunch.com/v1/me',
headers={'Authorization': f"Bearer {os.environ['BLOGHUNCH_API_KEY']}"},
)
print(res.json()['data'])$ch = curl_init('https://api.bloghunch.com/v1/me');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . getenv('BLOGHUNCH_API_KEY')]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);Make your first content request
GEThttps://api.bloghunch.com/v1/posts
Fetch published posts for your site. If you are using an Organization-Wide API key, include X-Publication-Id: {publication_id} (or X-Publication-Subdomain: {subdomain}).
GET/v1/posts
curl -G https://api.bloghunch.com/v1/posts \
-H "Authorization: Bearer {token}" \
-d limit=10 \
-d status=publishconst res = await fetch('https://api.bloghunch.com/v1/posts?limit=10&status=publish', {
headers: {
Authorization: `Bearer ${process.env.BLOGHUNCH_API_KEY}`,
},
})
const { data, meta } = await res.json()import os, requests
res = requests.get(
'https://api.bloghunch.com/v1/posts',
headers={'Authorization': f"Bearer {os.environ['BLOGHUNCH_API_KEY']}"},
params={'limit': 10, 'status': 'publish'},
)
posts = res.json()['data']$ch = curl_init('https://api.bloghunch.com/v1/posts?limit=10&status=publish');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . getenv('BLOGHUNCH_API_KEY')]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$posts = json_decode(curl_exec($ch), true)['data'];