{
  "openapi": "3.0.1",
  "info": {
    "title": "Financial Data API - Stocks, ETFs, Funds, Indicators, YCharts",
    "description": "Pull stock metrics and history, mutual fund and ETF data, fund holdings, institutional and insider ownership, economic indicator values and time series, and your saved screens and watchlists from the YCharts API into a dataset. Bring your own API key.",
    "version": "0.1",
    "x-build-id": "1hTouVeJY3RGmJX3w"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~financial-data-api-stocks-funds-indicators/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-financial-data-api-stocks-funds-indicators",
        "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/nabeelbaghoor~financial-data-api-stocks-funds-indicators/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-financial-data-api-stocks-funds-indicators",
        "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/nabeelbaghoor~financial-data-api-stocks-funds-indicators/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-financial-data-api-stocks-funds-indicators",
        "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": "What to read",
            "enum": [
              "stockData",
              "stockMetrics",
              "stockOwnership",
              "fundData",
              "fundHoldings",
              "fundAllHoldings",
              "indicatorSearch",
              "indicatorInfo",
              "indicatorPoints",
              "indicatorSeries",
              "securityLists",
              "screeners",
              "screenerResults",
              "watchlists",
              "watchlistItems"
            ],
            "type": "string",
            "description": "Stock data and fund data read up to 25 tickers per request, as a snapshot or as one row per date over a range. Ownership, holdings and the metric catalogue describe stocks and funds. The indicator modes search and read YCharts' economic data. The last five read the security lists, screens and watchlists saved in your own YCharts account.",
            "default": "stockData"
          },
          "symbols": {
            "title": "Ticker symbols",
            "type": "array",
            "description": "Stock data, ownership, fund data and holdings. Ticker symbols such as AAPL, MSFT or BRK.B for stocks, and VFIAX or SPY for funds and ETFs, one per line. Stock modes refuse funds and fund modes refuse stocks.",
            "items": {
              "type": "string"
            }
          },
          "metrics": {
            "title": "Stock metrics",
            "type": "array",
            "description": "Stock data. Up to 25 metric codes such as price or market_cap, one per line. Leave empty for YCharts' default set of popular metrics. The stock metric catalogue mode lists every code.",
            "items": {
              "type": "string"
            }
          },
          "date": {
            "title": "Single date",
            "type": "string",
            "description": "Stock data, fund data and indicator value. Read each metric's latest value on or before this date, in the form YYYY-MM-DD. For the indicator value mode you can also give -N for N periods back. Takes precedence over a date range."
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Stock data and fund data: a start date in the form YYYY-MM-DD turns the snapshot into one row per date. Indicator time series (required): a date or -N for N periods back."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Same modes as the start date. Stock and fund history defaults to today. Required for the indicator time series."
          },
          "indicatorCodes": {
            "title": "Indicator codes",
            "type": "array",
            "description": "Indicator info, value and time series. Codes such as I:USGDP, I:10YTR or I:USICUI, one per line, read 25 to a request. The economic indicator search mode lists codes.",
            "items": {
              "type": "string"
            }
          },
          "infoFields": {
            "title": "Indicator info fields",
            "type": "array",
            "description": "Indicator info. Field names such as security_name, description, last_value, change_year_ago, data_type or adjustment. Defaults to security_name and description. A field the API does not know comes back empty with a note.",
            "items": {
              "type": "string"
            }
          },
          "resampleFrequency": {
            "title": "Resample frequency",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "quarterly",
              "yearly"
            ],
            "type": "string",
            "description": "Indicator time series. Resample each series to this frequency. Needs a resample function too."
          },
          "resampleFunction": {
            "title": "Resample function",
            "enum": [
              "min",
              "max",
              "mean",
              "sum",
              "first",
              "last"
            ],
            "type": "string",
            "description": "Indicator time series. How values are combined when resampling."
          },
          "fillMethod": {
            "title": "Fill method",
            "enum": [
              "backward",
              "forward",
              "no_fill"
            ],
            "type": "string",
            "description": "Indicator time series. How missing values are filled."
          },
          "aggregateFunction": {
            "title": "Aggregate function",
            "enum": [
              "min",
              "max",
              "mean",
              "median",
              "sum",
              "std"
            ],
            "type": "string",
            "description": "Indicator time series. Return one statistic per indicator over the range instead of the series."
          },
          "forceDateRange": {
            "title": "Force date range",
            "type": "boolean",
            "description": "Indicator time series. Peg the resampled series to exactly the requested dates.",
            "default": false
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Economic indicator search. Region codes such as USA or CAN, one per line.",
            "items": {
              "type": "string"
            }
          },
          "indicatorSources": {
            "title": "Sources",
            "type": "array",
            "description": "Economic indicator search. Source internal names such as department_of_labor or department_of_the_treasury.",
            "items": {
              "type": "string"
            }
          },
          "indicatorCategories": {
            "title": "Categories",
            "type": "array",
            "description": "Economic indicator search. Category internal names such as gdp or interest_rates.",
            "items": {
              "type": "string"
            }
          },
          "indicatorReports": {
            "title": "Reports",
            "type": "array",
            "description": "Economic indicator search. Report internal names such as house_price_index or finra_margin_statistics.",
            "items": {
              "type": "string"
            }
          },
          "listSearch": {
            "title": "Security list search",
            "type": "string",
            "description": "Security lists. Words matched against list names, such as dividend or s&p 500. Leave empty to list everything."
          },
          "screenerType": {
            "title": "Screen type",
            "enum": [
              "company",
              "fund"
            ],
            "type": "string",
            "description": "Saved screens and screen results. Company screens or fund screens.",
            "default": "company"
          },
          "screenerIds": {
            "title": "Screen IDs",
            "type": "array",
            "description": "Screen results. The numeric IDs of saved screens, from the id column of the saved screens mode, one per line.",
            "items": {
              "type": "string"
            }
          },
          "watchlistIds": {
            "title": "Watchlist IDs",
            "type": "array",
            "description": "Watchlist items. The numeric IDs of watchlists, from the id column of the watchlists mode, one per line.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Saved screens and watchlists. Only those whose name contains this text."
          },
          "includeMine": {
            "title": "Include mine",
            "type": "boolean",
            "description": "Saved screens and watchlists. Include the ones you own.",
            "default": true
          },
          "includeShared": {
            "title": "Include shared with me",
            "type": "boolean",
            "description": "Saved screens and watchlists. Include the ones others shared with you.",
            "default": true
          },
          "includePublic": {
            "title": "Include public",
            "type": "boolean",
            "description": "Saved screens and watchlists. Include public ones from YCharts.",
            "default": true
          },
          "watchlistType": {
            "title": "Watchlist type",
            "enum": [
              "both",
              "multi",
              "indicator"
            ],
            "type": "string",
            "description": "Watchlists. Security watchlists, indicator watchlists, or both.",
            "default": "both"
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "recent",
              "name",
              "owner"
            ],
            "type": "string",
            "description": "Saved screens and watchlists. Most recently changed first, by name, or by owner.",
            "default": "recent"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for, across all symbols and codes. Paged routes are read up to 500 or 1000 rows a page.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing. YCharts allows 10 requests per second and 10,000 per hour per key; the actor waits and retries when the provider answers 429.",
            "default": 120
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own YCharts API key, from the API page of your YCharts account (needs the API V4 add-on). Stored as a secret and sent only in the x-ychartsauthorization header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}