{
  "openapi": "3.0.1",
  "info": {
    "title": "Financials Normalizer",
    "description": "Standardises company financial statements from official filings (SEC XBRL and Companies House UK), with growth metrics, earnings-quality flags, and revenue-by-segment breakdowns -- every number linked back to its source filing.",
    "version": "0.1",
    "x-build-id": "cwJWcvGMcBCjsxgeg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/roseapps~financials-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-roseapps-financials-normalizer",
        "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/roseapps~financials-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-roseapps-financials-normalizer",
        "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/roseapps~financials-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-roseapps-financials-normalizer",
        "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": [
          "secUserAgent"
        ],
        "properties": {
          "tickers": {
            "title": "Tickers",
            "type": "array",
            "description": "US-listed stock tickers, e.g. AAPL, MSFT. Resolved to CIKs via SEC's company_tickers.json.",
            "default": [
              "AAPL"
            ],
            "items": {
              "type": "string"
            }
          },
          "ciks": {
            "title": "CIKs",
            "type": "array",
            "description": "SEC Central Index Keys, with or without leading zeros or a 'CIK' prefix (e.g. 320193, 0000320193, CIK0000320193). Use when you know the CIK directly, or for filers without a ticker.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ukCompanyNumbers": {
            "title": "UK company numbers",
            "type": "array",
            "description": "Companies House company numbers, e.g. 04007092. Requires companiesHouseApiKey. Fetches and standardises the company's latest available accounts -- see the README for what to expect from micro-entity/PDF-only filings.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statements": {
            "title": "Statements",
            "type": "array",
            "description": "Which statements to include standardised line items for. Defaults to all three.",
            "items": {
              "type": "string",
              "enum": [
                "IS",
                "BS",
                "CF"
              ],
              "enumTitles": [
                "Income statement",
                "Balance sheet",
                "Cash flow statement"
              ]
            },
            "default": [
              "IS",
              "BS",
              "CF"
            ]
          },
          "periods": {
            "title": "Periods",
            "enum": [
              "annual",
              "quarterly",
              "ttm"
            ],
            "type": "string",
            "description": "Annual (fiscal-year) rows, quarterly rows (with Q4 derived when not separately reported), or a single trailing-twelve-months row.",
            "default": "annual"
          },
          "years": {
            "title": "Years of history",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many fiscal years back to include (also bounds the quarters/TTM window). Max 20.",
            "default": 5
          },
          "pointInTime": {
            "title": "Point in time",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD). If set, only filings filed on or before this date are considered -- reproduces what was known as of that date, excluding later restatements.",
            "default": ""
          },
          "includeRawTags": {
            "title": "Include raw tag sample",
            "type": "boolean",
            "description": "When true, adds a raw_facts_sample field to each row with a sample of the underlying XBRL facts (tag, value, accession) behind the standardised numbers.",
            "default": false
          },
          "includeSegments": {
            "title": "Include revenue by segment/geography",
            "type": "boolean",
            "description": "When true, adds a `segments` field to each US row with a revenue-by-product/geography breakdown parsed from the filing's own disclosure note, when the filer reports one (single-segment companies and some filers won't have one -- an empty list is a valid, honest result). Costs 1-2 extra requests per filing, so it's off by default to keep a normal run fast.",
            "default": false
          },
          "secUserAgent": {
            "title": "SEC User-Agent",
            "type": "string",
            "description": "Required by SEC's fair access policy for all requests to sec.gov / data.sec.gov. Format: \"Your Company Name contact@example.com\". Replace the prefilled value with your own -- SEC asks that this identify the actual requester, not a shared default.",
            "default": "RoseApps FinancialsNormalizer support@eliterose.digital"
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key (phase 2)",
            "type": "string",
            "description": "Not used yet -- reserved for the phase-2 Companies House module (src/uk.py)."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of companies processed in parallel.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}