Skillz Market SDK
API Reference

Analytics API

REST API endpoints for tracking views, calls, and engagement metrics.

Analytics API

Track skill engagement with views, calls, favorites, and usage analytics.

Overview

The analytics system tracks:

  • Views - When a skill page is viewed
  • Calls - When a skill is executed
  • Favorites - When users favorite a skill
  • Revenue - Total earnings per skill

Track View

POST /analytics/view

Record a skill page view.

Request:

curl -X POST https://api.skillz.market/analytics/view \
  -H "Content-Type: application/json" \
  -d '{"skillId": "uuid"}'

Parameters:

FieldTypeRequiredDescription
skillIdstringYesUUID of the skill

Response:

{
  "success": true
}

Views are deduplicated by IP address within a time window.


Track Call

POST /analytics/call

Record a skill execution. Typically called by the x402 middleware after successful payment.

Request:

curl -X POST https://api.skillz.market/analytics/call \
  -H "Content-Type: application/json" \
  -d '{
    "skillId": "uuid",
    "amount": "0.01"
  }'

Parameters:

FieldTypeRequiredDescription
skillIdstringYesUUID of the skill
amountstringNoPayment amount in USDC

Response:

{
  "success": true
}

Track Usage

POST /analytics/usage

Record detailed usage for consumer balance tracking.

Request:

curl -X POST https://api.skillz.market/analytics/usage \
  -H "Authorization: Bearer <consumer-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "skillId": "uuid",
    "amount": 1000
  }'

Parameters:

FieldTypeRequiredDescription
skillIdstringYesUUID of the skill
amountnumberYesAmount in micro-dollars

Response:

{
  "success": true,
  "usageId": "uuid"
}

Toggle Favorite

POST /analytics/favorite

Toggle favorite status for a skill.

Request:

curl -X POST https://api.skillz.market/analytics/favorite \
  -H "Content-Type: application/json" \
  -d '{
    "skillId": "uuid",
    "action": "add"
  }'

Parameters:

FieldTypeRequiredDescription
skillIdstringYesUUID of the skill
actionstringYesadd or remove

Response:

{
  "success": true,
  "favoriteCount": 42
}

Get Skill Analytics

GET /analytics/:skillId

Get analytics for a specific skill.

Request:

curl https://api.skillz.market/analytics/uuid

Response:

{
  "skillId": "uuid",
  "callCount": 1234,
  "viewCount": 5678,
  "favoriteCount": 89,
  "totalRevenue": "123.45",
  "lastCalledAt": "2024-01-15T00:00:00Z",
  "lastViewedAt": "2024-01-15T12:00:00Z"
}

Analytics in Skill Responses

When fetching skill details, analytics are included:

curl https://api.skillz.market/skills/my-skill
{
  "id": "uuid",
  "slug": "my-skill",
  "name": "My Skill",
  "price": "0.01",
  "currency": "USDC",
  "callCount": 1234,
  "viewCount": 5678,
  "favoriteCount": 89
}

Dashboard Analytics

Creators can view aggregate analytics for all their skills in the web dashboard:

  • Total calls across all skills
  • Total revenue earned
  • Most popular skills by views/calls
  • Recent activity timeline

Notes

  • View tracking uses IP-based deduplication
  • Call tracking is triggered by successful x402 payments
  • Favorite counts are updated in real-time
  • Revenue is calculated from successful skill usage records

On this page