Search and browse blog posts by keyword, slug, status, category, or tags. Use when asked to find, list, or look up existing blog posts.
Search and browse existing blog posts without modifying anything.
| Endpoint | Purpose |
|---|---|
GET /api/blog/posts | List / search posts |
GET /api/blog/posts/[slug] | Get single post |
Authentication: Use x-api-key header with BLOG_API_KEY from .env.api
source scripts/load-env.sh
API_KEY=$(grep BLOG_API_KEY .env.api | cut -d'=' -f2)
curl -s "http://localhost:3000/api/blog/posts?status=published&limit=50" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, status, category}'
curl -s "http://localhost:3000/api/blog/posts?status=draft&limit=50" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, status}'
curl -s "http://localhost:3000/api/blog/posts?limit=100" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, status, category}'
curl -s "http://localhost:3000/api/blog/posts/[slug]" \
-H "x-api-key: $API_KEY" | jq '{title, slug, status, category, tags, description, published_at, updated_at}'
curl -s "http://localhost:3000/api/blog/posts/[slug]" \
-H "x-api-key: $API_KEY" | jq '{title, slug, content}'
curl -s "http://localhost:3000/api/blog/posts?category=Guides&limit=50" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, category}'
Categories: Guides, Tips, Comparisons, News, Technical
curl -s "http://localhost:3000/api/blog/posts?limit=100" \
-H "x-api-key: $API_KEY" | jq '{
total: (.data | length),
published: ([.data[] | select(.status == "published")] | length),
draft: ([.data[] | select(.status == "draft")] | length)
}'
curl -s "http://localhost:3000/api/blog/posts?status=published&limit=100" \
-H "x-api-key: $API_KEY" | jq '[.data[].category] | group_by(.) | map({category: .[0], count: length})'
KEYWORD="upscale"
curl -s "http://localhost:3000/api/blog/posts?limit=100" \
-H "x-api-key: $API_KEY" | jq --arg k "$KEYWORD" '[.data[] | select(.title | ascii_downcase | contains($k | ascii_downcase))] | .[] | {slug, title}'
curl -s "http://localhost:3000/api/blog/posts/[slug]" \
-H "x-api-key: $API_KEY" | jq '{
title, seo_title, description, seo_description,
titleLength: (.title | length),
descriptionLength: (.description | length),
seoTitleLength: ((.seo_title // "") | length),
seoDescriptionLength: ((.seo_description // "") | length)
}'
curl -s "http://localhost:3000/api/blog/posts?status=published&limit=10" \
-H "x-api-key: $API_KEY" | jq '[.data[] | {slug, title, published_at}] | sort_by(.published_at) | reverse'
curl -s "http://localhost:3000/api/blog/posts?limit=100" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, tags}'
TAG="AI"
curl -s "http://localhost:3000/api/blog/posts?limit=100" \
-H "x-api-key: $API_KEY" | jq --arg t "$TAG" '[.data[] | select(.tags | any(. == $t))] | .[] | {slug, title, tags}'
echo $API_KEYcurl -s http://localhost:3000/api/health/blog-edit - Edit existing blog posts/blog-publish - Create new blog posts