{
  "openapi": "3.0.1",
  "info": {
    "title": "Crypto ETF Flow Tracker — Bitcoin & Ethereum ETF Inflows, IBIT",
    "description": "Track daily Bitcoin and Ethereum spot ETF net inflows and outflows from SoSoValue, including BlackRock IBIT, Grayscale GBTC, Fidelity FBTC, and ARK. JSON rows include date, net flow, cumulative flow, AUM, and volume. Optional SOL futures-backed fund group. No API key.",
    "version": "1.4",
    "x-build-id": "xY13cTM1V3ytiaXQQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gochujang~crypto-etf-flow-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gochujang-crypto-etf-flow-tracker",
        "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/gochujang~crypto-etf-flow-tracker/runs": {
      "post": {
        "operationId": "runs-sync-gochujang-crypto-etf-flow-tracker",
        "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/gochujang~crypto-etf-flow-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-gochujang-crypto-etf-flow-tracker",
        "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": {
          "etfTypes": {
            "title": "ETF Types",
            "type": "array",
            "description": "ETF groups to track. BTC and ETH groups are spot; us-sol-spot is futures-backed. Example: [\"us-btc-spot\"].",
            "default": [
              "us-btc-spot",
              "us-eth-spot",
              "us-sol-spot"
            ],
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Days Back",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Number of past days of daily flow data to return. Max 365. Alias: lookbackDays.",
            "default": 30
          },
          "lookbackDays": {
            "title": "Lookback (days) [deprecated — use daysBack]",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Return the last N days of daily flow data. Max 365. Superseded by daysBack. Example: 7; ignored when daysBack is supplied.",
            "default": 30
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "date_desc",
              "date_asc",
              "abs_inflow_desc",
              "net_flow_desc"
            ],
            "type": "string",
            "description": "Sort order across the returned dataset. When rankByNetFlow=true and this is not set, net_flow_desc is used automatically. Example: \"date_desc\".",
            "default": "date_desc"
          },
          "alertOutflowUsd": {
            "title": "Telegram Alert: Daily Outflow Threshold (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Send Telegram alert when the most recent day's net outflow exceeds this $ amount. 0 = disabled. Requires telegramBotToken + telegramChatId. Example: 100000000 for a $100M outflow.",
            "default": 0
          },
          "alertInflowUsd": {
            "title": "Telegram Alert: Daily Inflow Threshold (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Send Telegram alert when the most recent day's net inflow exceeds this $ amount. 0 = disabled. Example: 100000000 for a $100M inflow.",
            "default": 0
          },
          "telegramBotToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Telegram bot token for flow alerts. Leave empty to disable. Example: a private bot token, not the literal text here."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID",
            "type": "string",
            "description": "Chat ID (user or group) to receive flow alerts. Example: \"123456789\" from your Telegram chat.",
            "default": ""
          },
          "rollingAvgDays": {
            "title": "Rolling average window (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Days for rolling average inflow calculation and rotation signal. Default = 7. Example: 7.",
            "default": 7
          },
          "webhookUrl": {
            "title": "Webhook URL (Slack / Discord / custom)",
            "type": "string",
            "description": "POST flow alerts to any webhook URL. Supports Slack Incoming Webhooks, Discord webhooks, n8n, Zapier, and raw JSON endpoints. Leave empty to disable. Example: \"https://hooks.example.com/etf\" for your own webhook.",
            "default": ""
          },
          "includeIndividualEtfs": {
            "title": "Include Individual ETF Breakdown",
            "type": "boolean",
            "description": "When true, per_type summary includes per-ETF ticker breakdown (IBIT, FBTC, ARKB, etc.). Disable to reduce output size. Example: false for smaller output.",
            "default": true
          },
          "alertOnOutflow": {
            "title": "Alert on Any Outflow",
            "type": "boolean",
            "description": "When true, SUMMARY includes an outflow_alert flag with details for any ETF type that had a net outflow on the most recent day. Example: true.",
            "default": false
          },
          "includeSolanaETFs": {
            "title": "Include Solana ETFs",
            "type": "boolean",
            "description": "When true, ensures us-sol-spot (covering SOLZ, SOLT and other US-listed Solana ETFs) is included even if not specified in etfTypes. Adds a note to the SOL summary with known ticker symbols. Example: true to include the SOL fund group.",
            "default": false
          },
          "netFlowHistory": {
            "title": "Net Flow 7-Day History",
            "type": "boolean",
            "description": "When true, adds flow_7d_history to each per-type summary: an array of {date, net_flow_usd} for the last 7 trading days. Example: true.",
            "default": false
          },
          "rankByNetFlow": {
            "title": "Rank by Net Flow",
            "type": "boolean",
            "description": "When true (and sortBy is not explicitly set), rows are sorted by net_inflow_usd descending — largest inflows first. Set to false to restore the legacy date_desc default. Example: false to keep date sorting.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}