AdScan API Documentation

Use the AdScan API to integrate ad tracking and management into your applications.

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer adscan_live_your_api_key_here

You can create and manage API keys from the API Keys page in your dashboard.

Base URL

https://adscan.com/api/v1/trpc

How to Use tRPC

AdScan uses tRPC for its API. Each procedure is called via a POST request to a specific endpoint.

The endpoint format is: /api/v1/trpc/[router].[procedure]

Available Endpoints

Boards

  • boards.list - List all your boards
  • boards.create - Create a new board
  • boards.update - Update a board
  • boards.remove - Delete a board

Ads

  • ads.list - List ads with filters
  • ads.getDetails - Get detailed ad information
  • ads.addToBoard - Add an ad to a board
  • ads.removeFromBoard - Remove ad from board
  • ads.delete - Delete an ad
  • ads.listBoardsContaining - Find boards containing a specific ad
  • ads.getFilterValues - Get available filter options
  • ads.listTopCompanies - Get top companies

Companies

  • companies.follow - Follow a company
  • companies.unfollow - Unfollow a company

API Keys

  • apiKeys.list - List your API keys
  • apiKeys.create - Create a new API key
  • apiKeys.revoke - Revoke an API key

Example: List Boards

This example shows how to fetch all your boards.

Request

POST https://adscan.com/api/v1/trpc/boards.list
Authorization: Bearer adscan_live_your_api_key_here
Content-Type: application/json

{}

Response

{
  "result": {
    "data": [
      {
        "id": 1,
        "name": "My Board",
        "order": 0,
        "published": true,
        "createdAt": "2024-01-01T00:00:00.000Z",
        "authorId": "user123",
        "views": 0,
        "parentBoardId": null
      }
    ]
  }
}

Example: Create a Board

This example shows how to create a new board.

Request

POST https://adscan.com/api/v1/trpc/boards.create
Authorization: Bearer adscan_live_your_api_key_here
Content-Type: application/json

{
  "name": "My New Board",
  "parentId": null
}

Response

{
  "result": {
    "data": {
      "id": 42,
      "name": "My New Board",
      "parentId": null
    }
  }
}

Example: List Ads with Filters

This example shows how to fetch ads with various filters.

Request

POST https://adscan.com/api/v1/trpc/ads.list
Authorization: Bearer adscan_live_your_api_key_here
Content-Type: application/json

{
  "boardId": 1,
  "search": "marketing",
  "platforms": ["Facebook", "Google"],
  "limit": 20,
  "cursor": null
}

Response

{
  "result": {
    "data": {
      "ads": [...],
      "nextCursor": "ad_hash_123",
      "hasMore": true
    }
  }
}

Error Handling

The API returns standard HTTP status codes. Common errors include:

Rate Limits

API requests are rate-limited to prevent abuse. If you exceed the rate limit, you'll receive a 429 status code. Contact support if you need higher rate limits for your integration.

Support

If you have questions or need help with the API, please contact us at [email protected]