{
  "openapi": "3.0.1",
  "info": {
    "title": "CFPB Consumer Complaint Monitor",
    "description": "Search and monitor company-level consumer complaints via the official CFPB Consumer Complaint Database API. No API key required.",
    "version": "0.1",
    "x-build-id": "ubZd8f4hKMhWX3mEQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mooseandraven~cfpb-consumer-complaint-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mooseandraven-cfpb-consumer-complaint-monitor",
        "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/mooseandraven~cfpb-consumer-complaint-monitor/runs": {
      "post": {
        "operationId": "runs-sync-mooseandraven-cfpb-consumer-complaint-monitor",
        "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/mooseandraven~cfpb-consumer-complaint-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-mooseandraven-cfpb-consumer-complaint-monitor",
        "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": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "One or more query objects, each run as a single request against the official CFPB Consumer Complaint Database API (no key, no account). Each query's \"type\" must be \"complaints\" (the only record type this API offers). \"filters\" is optional but strongly recommended: this API has NO working pagination (see README/MAINTENANCE.md), so every query is capped at a hard 10,000-result ceiling regardless of maxRecordsPerQuery — narrow filters (company + a date range, or product + state) are the only way to see a query's full, true match set rather than a truncated top-10,000 slice.",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "title": "Label",
                  "type": "string",
                  "description": "Your own name for this query, used to track monitor-mode state and to tag output/status records. Required for stable incremental monitoring across runs — an unlabeled query is auto-named by its position (\"query-0\"), which breaks if you reorder the array."
                },
                "type": {
                  "title": "Query type",
                  "type": "string",
                  "enum": [
                    "complaints"
                  ],
                  "description": "Only \"complaints\" exists on this API. Present for consistency with this fleet's other multi-type actors and future extension."
                },
                "sort": {
                  "title": "Sort order",
                  "type": "string",
                  "enum": [
                    "created_date_desc",
                    "created_date_asc",
                    "relevance_desc"
                  ],
                  "description": "created_date_desc (default) surfaces the newest complaints first — the right choice for monitoring. relevance_desc only matters when searchTerm is set.",
                  "default": "created_date_desc"
                },
                "filters": {
                  "title": "Filters",
                  "type": "object",
                  "description": "Named filter fields, mapped internally to this API's own real parameter names — never passed through raw. Unknown keys are ignored (not an error), matching this API's own behavior on an unrecognized parameter. List-type fields accept either a single string or an array of strings (the API ORs multiple values for the same field).",
                  "editor": "json",
                  "default": {},
                  "properties": {
                    "company": {
                      "title": "Company name",
                      "type": "string",
                      "description": "Exact company name as CFPB records it, e.g. \"EQUIFAX, INC.\" (not a substring/fuzzy match — check the CFPB site's own company list for exact spelling). This \"filters\" object is entered as raw JSON (see the parent field's editor), so a JSON array of strings is also accepted here even though this schema documents the single-string case — the API ORs multiple values for the same field."
                    },
                    "product": {
                      "title": "Product",
                      "type": "string",
                      "description": "e.g. \"Mortgage\", \"Credit reporting or other personal consumer reports\", \"Debt collection\". A JSON array of strings is also accepted (see company)."
                    },
                    "issue": {
                      "title": "Issue",
                      "type": "string",
                      "description": "e.g. \"Improper use of your report\". A JSON array of strings is also accepted (see company)."
                    },
                    "state": {
                      "title": "State",
                      "type": "string",
                      "description": "Two-letter USPS state code, e.g. \"TX\". A JSON array of strings is also accepted (see company)."
                    },
                    "zipCode": {
                      "title": "ZIP code",
                      "type": "string",
                      "description": "5-digit ZIP code as CFPB records it (complaint ZIPs are sometimes partially redacted by CFPB itself for privacy, e.g. \"331XX\" — this is CFPB's own redaction, not a limitation of this actor). A JSON array of strings is also accepted (see company)."
                    },
                    "submittedVia": {
                      "title": "Submitted via",
                      "type": "string",
                      "description": "e.g. \"Web\", \"Phone\", \"Referral\". A JSON array of strings is also accepted (see company)."
                    },
                    "tags": {
                      "title": "Tags",
                      "type": "string",
                      "description": "CFPB's own complainant-population tags, e.g. \"Older American\", \"Servicemember\". A JSON array of strings is also accepted (see company)."
                    },
                    "timely": {
                      "title": "Timely response",
                      "type": "string",
                      "description": "\"Yes\" or \"No\" — whether the company responded within CFPB's required window. A JSON array of strings is also accepted (see company)."
                    },
                    "companyResponse": {
                      "title": "Company response",
                      "type": "string",
                      "description": "e.g. \"Closed with explanation\", \"Closed with monetary relief\". A JSON array of strings is also accepted (see company)."
                    },
                    "companyPublicResponse": {
                      "title": "Company public response",
                      "type": "string",
                      "description": "The company's own public reply category, when it chose to give one. A JSON array of strings is also accepted (see company)."
                    },
                    "dateReceivedMin": {
                      "title": "Date received — from (YYYY-MM-DD)",
                      "type": "string",
                      "description": "Inclusive lower bound on date_received. Combine with dateReceivedMax to keep a monitored query's true match count under the 10,000-result hard cap."
                    },
                    "dateReceivedMax": {
                      "title": "Date received — to (YYYY-MM-DD)",
                      "type": "string",
                      "description": "Inclusive upper bound on date_received."
                    },
                    "companyReceivedMin": {
                      "title": "Company-received date — from (YYYY-MM-DD)",
                      "type": "string",
                      "description": "Inclusive lower bound on date_sent_to_company."
                    },
                    "companyReceivedMax": {
                      "title": "Company-received date — to (YYYY-MM-DD)",
                      "type": "string",
                      "description": "Inclusive upper bound on date_sent_to_company."
                    },
                    "searchTerm": {
                      "title": "Free-text search",
                      "type": "string",
                      "description": "Full-text search across all complaint fields CFPB indexes for this. Switches the default sort relevance weighting on unless you also set \"sort\"."
                    }
                  }
                }
              },
              "required": [
                "type"
              ]
            },
            "default": [
              {
                "label": "navy-federal-example",
                "type": "complaints",
                "filters": {
                  "company": "NAVY FEDERAL CREDIT UNION",
                  "dateReceivedMin": "2025-06-01",
                  "dateReceivedMax": "2025-06-01"
                }
              }
            ]
          },
          "monitorMode": {
            "title": "Incremental monitor mode",
            "type": "boolean",
            "description": "When on, the actor remembers which complaint IDs it has already delivered per query (by Apify named key-value store) and only delivers genuinely new complaints on later scheduled runs, instead of re-delivering the whole match set every time. Most useful on a query narrowly scoped to one company (optionally + product), run on a schedule, to get notified only of NEW complaints. NOTE: this only detects new complaint IDs, not later changes to an already-delivered complaint's status fields (e.g. companyResponse). Charges one monitor-run PPE event in addition to per-record events -- but only on a run that delivers at least one new record; an empty or failed run is never charged monitor-run.",
            "default": false
          },
          "maxRecordsPerQuery": {
            "title": "Max records per query (quota/cost guard)",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap applied independently to each query, additionally bounded by this API's own hard 10,000-result-per-request ceiling (this actor cannot page past it — see README/MAINTENANCE.md). A query that matches more than the effective cap emits a loud search-truncated status record rather than silently stopping short. Set to 0 to use the full 10,000-result ceiling.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}