{
  "openapi": "3.0.1",
  "info": {
    "title": "CFPB Complaints Feed: Bank & Fintech Complaint Spikes",
    "description": "New consumer complaints against banks, lenders, credit bureaus, fintechs and debt collectors from the official CFPB Consumer Complaint Database, plus per-company counts vs prior window, product/issue mix and spike alerts. Filter by company, product, issue, state. No API key.",
    "version": "0.1",
    "x-build-id": "hw35XIX3I5N0W2avr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moment-data~cfpb-company-complaints-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moment-data-cfpb-company-complaints-feed",
        "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/moment-data~cfpb-company-complaints-feed/runs": {
      "post": {
        "operationId": "runs-sync-moment-data-cfpb-company-complaints-feed",
        "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/moment-data~cfpb-company-complaints-feed/run-sync": {
      "post": {
        "operationId": "run-sync-moment-data-cfpb-company-complaints-feed",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "complaints",
              "companySummary"
            ],
            "type": "string",
            "description": "complaints (default): one record per complaint, newest first. companySummary: one row per company with complaint counts in the window vs the prior window of the same length, product / issue / state mix, response stats and a spike flag.",
            "default": "complaints"
          },
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Company names, matched to the names CFPB uses (case-insensitive, partial names allowed, corporate suffixes ignored): e.g. Capital One, Wells Fargo, Chime, Block, Affirm, Navient. Each input can match up to 10 CFPB company names (see the run log and OUTPUT.resolution). Empty = all companies.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "Products",
            "type": "array",
            "description": "CFPB products or sub-products, e.g. Credit card, Mortgage, Debt collection, Checking or savings account, Student loan, Vehicle loan or lease, Money transfer, virtual currency, or money service, Store credit card. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "issues": {
            "title": "Issues",
            "type": "array",
            "description": "CFPB issues or sub-issues, e.g. Incorrect information on your report, Attempts to collect debt not owed, Trouble during payment process, Fraud or scam. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "2-letter state codes of the consumer's mailing address (TX, CA, FL, PR...). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Optional: servicemember and/or olderAmerican to keep only complaints CFPB tagged that way.",
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Days back (complaints mode)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Window of days received, ending today (UTC). If it holds fewer than Max items complaints, the window is widened step by step (14, 30, 60, 120, 240, 365 days) so a run always returns data despite CFPB's publication lag. sinceLastRun always rescans at least 45 days to catch late-published complaints.",
            "default": 7
          },
          "maxItems": {
            "title": "Max items per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on delivered complaints or company rows (also caps your spend). Default is small so a first run is quick and cheap.",
            "default": 30
          },
          "includeNarratives": {
            "title": "Include consumer narrative (if published)",
            "type": "boolean",
            "description": "Adds a narrative field with CFPB's scrubbed consumer narrative when the API supplies one. Note: the public search API currently omits narrative text, so the field is usually null.",
            "default": false
          },
          "windowDays": {
            "title": "Window length in days (companySummary)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Length of the current window; the prior window is the same number of days immediately before it.",
            "default": 30
          },
          "lagDays": {
            "title": "Publication lag to skip (companySummary)",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "The current window ends this many days before the latest date received in the data, because CFPB publishes most complaints after the company responds or after 15 days. Lower values are fresher but undercount recent days.",
            "default": 14
          },
          "windowEnd": {
            "title": "Window end date (companySummary, optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Overrides the automatic window end (latest date minus lagDays)."
          },
          "spikeThresholdPct": {
            "title": "Spike threshold % (companySummary)",
            "type": "integer",
            "description": "A company is flagged spike: true when complaints grew by at least this percentage vs the prior window (or it had none before) and it has at least Min complaints.",
            "default": 50
          },
          "minComplaints": {
            "title": "Min complaints for a spike",
            "minimum": 1,
            "type": "integer",
            "description": "Ignore spikes at companies with fewer complaints than this in the current window (filters out noise like 1 -> 3).",
            "default": 20
          },
          "onlySpikes": {
            "title": "Only spiking companies (companySummary)",
            "type": "boolean",
            "description": "Deliver only rows with spike: true.",
            "default": false
          },
          "sortBy": {
            "title": "Sort company rows by",
            "enum": [
              "complaints",
              "growth",
              "change"
            ],
            "type": "string",
            "description": "Order of company rows; rows beyond Max items are dropped.",
            "default": "complaints"
          },
          "sinceLastRun": {
            "title": "New since last run (for schedules)",
            "type": "boolean",
            "description": "Opt-in. complaints mode: deliver only complaints not delivered before for this State key (rescans 45+ days to catch late-published ones; the first run delivers up to Max items and records the rest as seen). companySummary: deliver only spiking companies not already alerted in the last window. Default off = stateless.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the saved history for sinceLastRun. Use one key per schedule.",
            "default": "default"
          },
          "autoExtend": {
            "title": "Widen a short window (complaints mode)",
            "type": "boolean",
            "description": "Turn off to get exactly the Days back window.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}