API v2 Changelog
This page summarizes all changes between API v1 and v2. The new API is available at /api/v2/. The existing v1 API at /api/v1/ remains available in parallel.
New Base URL
/api/v1/...
/api/v2/...
Endpoint Overview (v2)
- GET /api/v2/{network}
- GET /api/v2/{network}/{profileId}
- GET /api/v2/{network}/{profileId}/{endpoint}
- GET /api/v2/profiles/connected
- GET /api/v2/profiles/queried
- GET /api/v2/docs
Available endpoints per profile: profile, profile/daily, posts, stories
Supported networks: facebook, instagram, x, youtube,
linkedin, pinterest, tiktok, threads, bluesky
Breaking Changes
The following changes in v2 are intentionally breaking and require updates to existing integrations.
Breaking 1. Authentication via Bearer Header
The API token is no longer passed as a query parameter. Use the Authorization header instead.
?token=YOUR_TOKEN
Authorization: Bearer YOUR_TOKEN
Example:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://app.fanpagekarma.com/api/v2/facebook/6815841748/profile"
Breaking 2. period Replaced by from / to
The period=YYYY-MM-DD_YYYY-MM-DD parameter is removed in v2. Use separate from and to parameters instead.
?period=2026-01-01_2026-01-31
?from=2026-01-01&to=2026-01-31
Rules:
- If both
fromandtoare omitted: default period (last 28 full days, excluding today). - If only
fromis set:todefaults to yesterday (UTC). - If
tois set,frommust also be set.
Breaking 3. Network Path twitter → x
The twitter network path has been removed in v2. Use x instead.
/api/v1/twitter/...
/api/v2/x/...
Breaking 4. Intentional Breaking Changes
v2 is a new major version with intentional breaking changes. It is not backwards-compatible with v1.
Breaking 5. KPI Alias Names Removed
In v2, only the current metric key names are returned. Legacy alias key names from the v1 fallback are no longer included in the response.
Breaking 6. Field Name kpi → metrics
In v2, the nested metrics object in post and story responses uses the field name metrics instead of kpi.
{
"kpi": { ... }
}
{
"metrics": { ... }
}
Breaking 7. Field Name task → endpoint
In v2, the metadata field for the requested path is named endpoint instead of task.
{
"task": "profile"
}
{
"endpoint": "profile"
}
Breaking 8. Structured Error Object
The metadata.error string field is removed. Instead, a top-level error object with code and message is returned.
{
"data": {},
"metadata": {
"error": "Invalid token."
}
}
{
"data": {},
"metadata": {
"version": "v2"
},
"error": {
"code": "INVALID_TOKEN",
"message": "Invalid token."
}
}
Possible error codes:
UNEXPECTED_ERROR, INVALID_ENDPOINT, NO_BEARER_TOKEN,
INVALID_BEARER_HEADER, INVALID_TOKEN, NO_PROFILE_ID,
INVALID_PROFILE_ID, NO_USER_FOR_ACCOUNT, EXCEEDED_ACCESS_LIMIT,
ACCOUNT_SUSPENDED, DATABASE_ERROR,
ENDPOINT_NOT_AVAILABLE_FOR_NETWORK, RATE_LIMIT_EXCEEDED,
INVALID_DATE_RANGE, MISSING_METRICS
Breaking 9. Date Format Changed to ISO 8601
All date fields now use ISO 8601 format.
"Thu Jan 22 00:00:00 UTC 2026"
"2026-01-22"
"Thu Jan 22 14:30:00 UTC 2026"
"2026-01-22T14:30:00Z"
Breaking 10. Metric description Field Removed
The description field has been removed from metric objects in data responses. Use the dedicated metrics catalog endpoint to retrieve metric descriptions.
{
"engagement": {
"title": "Engagement",
"description": "Average number of interactions...",
"value": 0.042,
"formatted_value": "4.2%"
}
}
{
"engagement": {
"title": "Engagement",
"value": 0.042,
"formatted_value": "4.2%"
}
}
Metric descriptions are available via:
GET /api/v2/{network}/{endpoint}/metrics
New Features
New Profile Daily Endpoint
The /profile/daily endpoint returns daily time series data for profile metrics.
fromandtoare both required parameters (YYYY-MM-DD)metricsis a required parameter — comma-separated list of metric API names- Response contains a time series per metric with
titleandvalues: [{date, value}] - Response data key is
"daily" - Available metric keys can be discovered via the
/profileendpoint
Example:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://app.fanpagekarma.com/api/v2/facebook/6815841748/profile/daily?from=2026-01-01&to=2026-01-31&metrics=page_follower,engagement"
New Metrics Filter for All Endpoints
The metrics query parameter is now supported on all data endpoints (/profile, /posts, /stories),
not just /profile/daily. Pass a comma-separated list of metric API names to return only the specified metrics.
- Required for
/profile/daily, optional for all other endpoints - If omitted on
/profile,/posts,/stories: all metrics are returned (same as before) - Use
GET /api/v2/{network}/{endpoint}/metricsto discover available metric keys
Example — only return engagement and page_follower for a profile:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://app.fanpagekarma.com/api/v2/facebook/6815841748/profile?metrics=page_follower,engagement"
New Pagination for Posts/Stories
Posts and stories endpoints now support limit and offset query parameters.
limit— Maximum number of returned items (default and max: 1000)offset— Number of items to skip (default: 0)- Metadata includes:
total_count,limit,offset
Example:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://app.fanpagekarma.com/api/v2/facebook/6815841748/posts?limit=5&offset=10"
New Rate-Limit Headers
All authenticated responses to /{network}/{profileId}/{endpoint} now include rate-limit information as HTTP headers:
X-RateLimit-Limit— Maximum requests per hour for this token/endpoint/profile combinationX-RateLimit-Remaining— Remaining requests in the current hourX-RateLimit-Reset— Unix timestamp (seconds) when the limit resets
New OpenAPI Documentation
The OpenAPI specification at /api/v2/docs now includes:
- Security schema (Bearer Token)
- Parameter descriptions with example values and allowed values
- Response documentation for all endpoints
Unchanged in v2
- API rate limits remain the same.
- Public demo profiles remain available; a demo token is no longer required for these.
Migration Checklist
Follow these steps to migrate your integration from v1 to v2:
- Change your base URL to
/api/v2/. - Remove the
tokenquery parameter and set theAuthorization: Bearer <token>header instead. - Replace
periodwith separatefromandtoparameters. - Change the
twitternetwork path tox. - Update post/story parsing: rename
kpitometrics. - Update metadata parsing: rename
tasktoendpoint. - Update error handling: parse
error.code/error.messageinstead ofmetadata.error. - Update date parsing to ISO 8601 format (
YYYY-MM-DDandYYYY-MM-DDTHH:mm:ssZ). - Optionally integrate the new OpenAPI spec at
/api/v2/docs. - For daily time series data, use the new
/profile/dailyendpoint. Requiresfrom,to, andmetricsparameters. - Remove any code that reads the
descriptionfield from metric objects. UseGET /api/v2/{network}/{endpoint}/metricsto retrieve metric descriptions separately.