{
  "openapi": "3.0.1",
  "info": {
    "title": "Creative Intelligence - AI Ad Creative Analysis",
    "description": "Analyze ad creatives from URLs or scraper datasets using the user's OpenAI, xAI, or Claude API key. Returns structured creative scoring, visual classifications, extracted text, hooks, and improvement suggestions.",
    "version": "0.0",
    "x-build-id": "Qcm9Na9OAK1uiR6On"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/whoareyouanas~creative-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-whoareyouanas-creative-intelligence",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/whoareyouanas~creative-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-whoareyouanas-creative-intelligence",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/whoareyouanas~creative-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-whoareyouanas-creative-intelligence",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "provider",
          "apiKey"
        ],
        "properties": {
          "provider": {
            "title": "AI Provider",
            "enum": [
              "openai",
              "xai",
              "anthropic"
            ],
            "type": "string",
            "description": "The AI provider to use for creative analysis.",
            "default": "openai"
          },
          "apiKey": {
            "title": "Provider API Key",
            "type": "string",
            "description": "Your API key for the selected provider. This field is stored encrypted by Apify and is only decrypted inside the actor run."
          },
          "model": {
            "title": "Model Override",
            "type": "string",
            "description": "Optional model name. Leave empty to use a provider-specific vision-capable default."
          },
          "creatives": {
            "title": "Creative Rows (JSON)",
            "type": "array",
            "description": "Simple JSON rows for anyone who has ad copy and creative assets. Each row needs at least an assetUrl, assetUrls, imageUrl, videoUrl, or mediaUrl. Common fields: id, brand, body, cta, assetUrl, assetType.",
            "default": []
          },
          "csvInput": {
            "title": "CSV Paste",
            "type": "string",
            "description": "Paste CSV from a spreadsheet. Supported headers include id, brand, body, cta, assetUrl, assetUrls, mediaUrl, imageUrl, videoUrl, assetType, format, active, runTimeDays, multipleVersions, similarAdCount, totalPlatforms, platforms. Use semicolon, pipe, or new lines inside assetUrls for multiple assets."
          },
          "sourceDatasetId": {
            "title": "Source Dataset ID or Name",
            "type": "string",
            "description": "Optional Apify dataset ID/name from a previous ads scraper run. If set, the actor reads ads from this dataset."
          },
          "ads": {
            "title": "Advanced Inline Ads (Scraper Shape)",
            "type": "array",
            "description": "Backward-compatible ad objects from scraper output. Each item can contain libraryID, brand, body, ctaText, format, images, videos, active, runTimeDays, multipleVersions, similarAdCount, and totalPlatforms.",
            "default": []
          },
          "maxAds": {
            "title": "Max Ads",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of creatives to analyze from all source inputs. Set to 0 for all available creatives.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of ads to analyze in parallel. Provider rate limits and image/video size affect reliability; 1-3 is recommended.",
            "default": 2
          },
          "analyzeVideos": {
            "title": "Analyze Videos",
            "type": "boolean",
            "description": "If enabled, video ads are downloaded and sampled into frames for multimodal analysis. Disable to skip video ads.",
            "default": true
          },
          "maxVideoFrames": {
            "title": "Max Video Frames",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum frames extracted from each video. More frames improve context but increase cost and latency.",
            "default": 8
          },
          "videoFrameIntervalSeconds": {
            "title": "Video Frame Interval Seconds",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Sample one frame every N seconds until max video frames is reached.",
            "default": 2
          },
          "imageInputMode": {
            "title": "Image Input Mode",
            "enum": [
              "url",
              "download"
            ],
            "type": "string",
            "description": "Use URL mode for public images. Use download mode if the provider cannot fetch image URLs directly.",
            "default": "url"
          },
          "imageDetail": {
            "title": "Image Detail",
            "enum": [
              "low",
              "high",
              "auto"
            ],
            "type": "string",
            "description": "Vision detail level. Higher detail can improve OCR and layout reasoning but usually costs more.",
            "default": "low"
          },
          "includeRawResponse": {
            "title": "Include Raw Provider Response",
            "type": "boolean",
            "description": "If enabled, saves the parsed raw provider response in each dataset item for debugging. Leave off for cleaner output.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}