{
  "openapi": "3.0.1",
  "info": {
    "title": "CFPB Complaint Intelligence — Vendor Risk & Screening",
    "description": "Turn 5M+ CFPB consumer complaints into decisions: screen companies pass / review / fail, score complaint-handling risk, monitor what changed since last run, benchmark cohorts, and build audit-ready due-diligence packs. Filter by company, product, state, and date. No API key.",
    "version": "2.5",
    "x-build-id": "gkApfxAgfSYs2wOcI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~cfpb-consumer-complaints/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-cfpb-consumer-complaints",
        "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/ryanclinton~cfpb-consumer-complaints/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-cfpb-consumer-complaints",
        "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/ryanclinton~cfpb-consumer-complaints/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-cfpb-consumer-complaints",
        "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": {
          "workflow": {
            "title": "Workflow (start here)",
            "enum": [
              "",
              "vendor-screening",
              "vendor-monitoring",
              "due-diligence",
              "audit-evidence",
              "competitive-monitoring"
            ],
            "type": "string",
            "description": "Pick the job you're doing and the actor configures the right mode for you. Leave blank to drive 'Output Mode' directly. An explicit Output Mode always overrides the workflow."
          },
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "records",
              "aggregation",
              "compare",
              "monitor",
              "cohort",
              "dueDiligence",
              "auditPack",
              "industryProfile",
              "timeseries",
              "trend",
              "stateRisk"
            ],
            "type": "string",
            "description": "What the actor returns. 'records' = one row per complaint. 'aggregation' = top-N count buckets. 'compare' = company risk leaderboard (pair with 'Companies to screen'). 'monitor' = only the companies that CHANGED since the last run + risk events (needs a watchlist name). 'cohort' = company leaderboard + averages across the companies in this run + each company's relative risk. 'dueDiligence' = a single board-ready vendor pack for one company. 'industryProfile' = a product-level risk picture (top issues, fastest-growing issues, highest-severity issues, real product-wide baseline, risk trend). 'timeseries' = monthly counts + velocity. 'trend' = current vs previous period change % + emerging issues + early warnings. 'stateRisk' = complaints per 100k by state.",
            "default": "records"
          },
          "aggregateBy": {
            "title": "Aggregate By (aggregation mode only)",
            "enum": [
              "company",
              "product",
              "sub_product",
              "issue",
              "sub_issue",
              "state",
              "company_response",
              "submitted_via",
              "tags",
              "timely"
            ],
            "type": "string",
            "description": "Field to group complaints by when Output Mode is 'aggregation'. Returns one row per bucket with {term, count, share}. Ignored when Output Mode is 'records'.",
            "default": "company"
          },
          "searchTerm": {
            "title": "Search Term",
            "type": "string",
            "description": "Keyword search across complaint narratives and fields (e.g., 'credit report', 'late fee', 'identity theft')."
          },
          "company": {
            "title": "Company",
            "type": "string",
            "description": "Filter by a single company name (e.g., 'Bank of America', 'Wells Fargo', 'Equifax'). Friendly names are auto-resolved to the exact CFPB registered name (CFPB matches the company field exactly). To screen several companies in one run, use 'Companies to screen' instead."
          },
          "companies": {
            "title": "Companies to screen (records mode)",
            "maxItems": 25,
            "type": "array",
            "description": "Screen multiple companies in one run. The actor runs one filtered query per company (Max Results applies per company), then — when 'Company risk summary' is on — ranks them by complaint-handling risk. Capped at 25 companies. Overrides the single 'Company' filter when set.",
            "items": {
              "type": "string"
            }
          },
          "product": {
            "title": "Product",
            "enum": [
              "",
              "Credit reporting, credit repair services, or other personal consumer reports",
              "Debt collection",
              "Mortgage",
              "Credit card or prepaid card",
              "Checking or savings account",
              "Student loan",
              "Vehicle loan or lease",
              "Money transfer, virtual currency, or money service",
              "Payday loan, title loan, or personal loan",
              "Personal loan"
            ],
            "type": "string",
            "description": "Filter by financial product type."
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Filter by US state code (e.g., 'CA', 'NY', 'TX')."
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Start date for complaint received date range (YYYY-MM-DD format)."
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "End date for complaint received date range (YYYY-MM-DD format)."
          },
          "sortBy": {
            "title": "Sort By (records mode only)",
            "enum": [
              "created_date_desc",
              "created_date_asc",
              "relevance_desc",
              "relevance_asc"
            ],
            "type": "string",
            "description": "Sort order for results. Ignored in aggregation mode (buckets are always sorted by count, descending).",
            "default": "created_date_desc"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of complaint records to return (1–10000). In aggregation mode, this caps how many buckets are emitted.",
            "default": 50
          },
          "autoPaginate": {
            "title": "Auto-paginate to fetch all matching",
            "type": "boolean",
            "description": "When enabled and total matching complaints exceed Max Results (but stay under the 10,000 single-query cap), the actor fetches every matching record up to 10,000. Beyond 10,000 records, switch to aggregation mode or split your query by date range. Records mode only.",
            "default": false
          },
          "enableCompanySummary": {
            "title": "Company risk summary (records mode)",
            "type": "boolean",
            "description": "Adds one company-summary row per company in the result set, ranked by complaint-handling risk: complaint count, untimely-response / dispute / relief rates, 12-month velocity trend, complaintRiskScore (0-100), riskLevel, A-F complianceRating, screeningResult (pass/review/fail) and recommendedAction — plus a run summary with the risk distribution and a pass/review/fail exceptions list. Scores are within-result-set signals (complaint volume is size-correlated, so the risk leans on response-quality rates, not raw count), never a cross-universe rating. Records mode only; not charged.",
            "default": false
          },
          "outputProfile": {
            "title": "Output Profile (records mode)",
            "enum": [
              "minimal",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "How much detail per row. 'standard' (default) and 'full' return every field. 'minimal' strips complaint rows down to the headline decision fields (company, productCategory, issue, responseType, reliefProvided, timelyResponse, severityClass, severityFlags, cfpbUrl) for lean CSV / automation ingestion.",
            "default": "standard"
          },
          "watchlistName": {
            "title": "Watchlist name (compare / company-summary mode)",
            "type": "string",
            "description": "Name a watchlist to track companies across scheduled runs. Each run stores every company's exact CFPB total + intelligence score under this name and reports newComplaintsSinceLastRun, a changeFlag, a persistent companyProfile (firstSeen / runs tracked / all-time-high score / score history / trend), and rank change. Works best with 'Companies to screen'. Leave blank for a one-shot run."
          },
          "portfolioName": {
            "title": "Portfolio name",
            "type": "string",
            "description": "Save a reusable company list under a name. Pass it WITH 'Companies to screen' to save/update the portfolio; pass it ALONE on later runs to reload the saved list (no need to re-paste). Pair with a watchlist name + a schedule for hands-off portfolio monitoring (e.g. 'Vendors', 'Banking Partners', 'Acquisition Targets')."
          },
          "trendIntervalMonths": {
            "title": "Interval (months) — timeseries / trend modes",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Time-series mode: how many trailing months to chart when no explicit date range is set (default 12). Trend mode: the length of the current period; the previous equal-length period is compared against it (default 3).",
            "default": 12
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}