{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ads Creative Performance Decline Audit",
    "description": "Compare two owned Meta ad-level Insights exports. Returns adId, earlierLinkCtrPercent, laterLinkCtrPercent, linkCpcRisePercent, frequencyRisePercent and source row numbers. $0.20 per ad with lower link CTR, higher link CPC and higher frequency.",
    "version": "0.2",
    "x-build-id": "oV2XHF5G5ORvETC2J"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/natstandridge~meta-ads-creative-fatigue-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-natstandridge-meta-ads-creative-fatigue-audit",
        "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/natstandridge~meta-ads-creative-fatigue-audit/runs": {
      "post": {
        "operationId": "runs-sync-natstandridge-meta-ads-creative-fatigue-audit",
        "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/natstandridge~meta-ads-creative-fatigue-audit/run-sync": {
      "post": {
        "operationId": "run-sync-natstandridge-meta-ads-creative-fatigue-audit",
        "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",
        "properties": {
          "exports": {
            "title": "Earlier and later ad-level Insights exports",
            "minItems": 2,
            "maxItems": 2,
            "type": "array",
            "description": "Send two objects with window (earlier or later) and rows. Each window accepts 1–5,000 ad-level Insights rows, up to 2 MiB. Each row needs date_start, date_stop, account_id, account_currency, objective, ad_id, impressions, inline_link_clicks, spend and frequency. Optional fields are ad_name and attribution_setting. Both windows must share reporting settings. Set demoSample=false and omit both CSV fields.",
            "items": {
              "type": "object"
            }
          },
          "demoSample": {
            "title": "Run an evergreen synthetic demo",
            "type": "boolean",
            "description": "Synthetic demo based on the last two completed seven-day windows in UTC. Delivers one marked finding for $0.20. Use the demo by itself. For your own data, set false and send either exports or the two CSV fields.",
            "default": false
          },
          "earlierCsv": {
            "title": "Earlier ad-level Insights CSV",
            "maxLength": 2097152,
            "type": "string",
            "description": "One summary row per ad_id. Use Meta Marketing API Insights field names: date_start,date_stop,account_id,account_currency,objective,ad_id,impressions,inline_link_clicks,spend,frequency. If attribution_setting is present, include it in both windows."
          },
          "laterCsv": {
            "title": "Later ad-level Insights CSV",
            "maxLength": 2097152,
            "type": "string",
            "description": "Same fields, account, currency, objective, attribution setting and duration as the earlier report; no overlapping dates. The later window must end within the last 14 days."
          },
          "minImpressions": {
            "title": "Minimum impressions per window",
            "minimum": 100,
            "maximum": 1000000,
            "type": "integer",
            "description": "Require this many impressions in each comparison window before evaluating an ad.",
            "default": 1000
          },
          "minLinkClicks": {
            "title": "Minimum inline link clicks per window",
            "minimum": 5,
            "maximum": 100000,
            "type": "integer",
            "description": "Require this many link clicks in each window before evaluating an ad.",
            "default": 20
          },
          "minSpend": {
            "title": "Minimum spend per window in the account currency",
            "minimum": 0,
            "maximum": 100000,
            "type": "number",
            "description": "Require this much spend in each window before evaluating an ad.",
            "default": 25
          },
          "minCtrDropPercent": {
            "title": "Minimum relative link CTR decline (%)",
            "minimum": 5,
            "maximum": 90,
            "type": "integer",
            "description": "Flag an ad only when later link click-through rate falls by at least this percentage relative to the earlier window.",
            "default": 20
          },
          "minCpcRisePercent": {
            "title": "Minimum relative link CPC increase (%)",
            "minimum": 5,
            "maximum": 500,
            "type": "integer",
            "description": "Flag an ad only when later cost per link click rises by at least this percentage relative to the earlier window.",
            "default": 25
          },
          "maxFindings": {
            "title": "Maximum review findings",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Default 10 findings fits the default $2 run charge cap at $0.20 each. Raise both limits for more rows.",
            "default": 10
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}