{
  "openapi": "3.0.1",
  "info": {
    "title": "Currency & Metals Monitor — FX, Gold, Silver & Price Changes",
    "description": "Get daily ECB currency reference rates and indicative gold/silver prices. Track a watchlist across runs, compare changes and detect threshold crossings. JSON/CSV, source dates and freshness diagnostics. No source API key.",
    "version": "0.1",
    "x-build-id": "MiVpGlfzdzYyEwMlK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apivault_labs~fx-metals-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apivault_labs-fx-metals-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/apivault_labs~fx-metals-monitor/runs": {
      "post": {
        "operationId": "runs-sync-apivault_labs-fx-metals-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/apivault_labs~fx-metals-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-apivault_labs-fx-metals-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "latest",
              "monitor"
            ],
            "type": "string",
            "description": "Latest returns a snapshot. Monitor persists the previous observation and returns baselines or price changes.",
            "default": "latest"
          },
          "pairs": {
            "title": "Currency pairs",
            "type": "array",
            "description": "Daily currency reference rates, not broker bid/ask. Up to 50 total unique instruments.",
            "items": {
              "type": "string"
            },
            "default": [
              "EUR/USD",
              "GBP/USD"
            ]
          },
          "metals": {
            "title": "Metals",
            "type": "array",
            "description": "XAU gold, XAG silver, XPT platinum and XPD palladium in USD. For industrial materials use referenceMetals.",
            "items": {
              "type": "string"
            },
            "default": [
              "XAU",
              "XAG"
            ]
          },
          "metalUnit": {
            "title": "Metal price unit",
            "enum": [
              "troy_ounce",
              "gram"
            ],
            "type": "string",
            "description": "Precious metal prices in USD per troy ounce or gram; not an industrial-metal unit.",
            "default": "troy_ounce"
          },
          "monitorKey": {
            "title": "Monitor key",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "type": "string",
            "description": "Persistent history in your Apify account. Change the key when changing watchlist, units, thresholds or freshness policy.",
            "default": "default"
          },
          "thresholds": {
            "title": "Threshold rules",
            "type": "array",
            "description": "Example: [{\"instrument\":\"XAU/USD\",\"above\":4500,\"changePercent\":1}]. Threshold units follow metalUnit; changePercent compares consecutive observations. First baseline never triggers.",
            "default": []
          },
          "maxResults": {
            "title": "Maximum delivered quotes",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum useful quote rows delivered to the Dataset in this run, from 1 to 50.",
            "default": 50
          },
          "maxMetalAgeMinutes": {
            "title": "Maximum metal provider-cache age (minutes)",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "Reference precious metals only: maximum age of providerFetchedAt, checked during collection and before result delivery. This is provider cache age, not market observation age. Older prices produce diagnostics and preserve monitor state.",
            "default": 30
          },
          "maxFxAgeDays": {
            "title": "Maximum currency reference age (calendar days)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Reference dates naturally precede today during holidays/weekends; no fabricated timestamp.",
            "default": 5
          },
          "recoverPending": {
            "title": "Recover an interrupted delivery",
            "type": "boolean",
            "description": "Verify the previous delivery receipt stored in monitor KVS before resuming. Hard kills without a receipt require operator review. Does not blindly resend old rows or inspect previous run metadata.",
            "default": false
          },
          "maxCostUsd": {
            "title": "Maximum quote fees (USD)",
            "minimum": 0,
            "maximum": 10,
            "type": "number",
            "description": "Additional hard cap on quote result fees only. Zero returns no quote rows. Apify compute/storage costs remain separate. Applied together with platform charge limits.",
            "default": 0.05
          },
          "quoteSource": {
            "title": "Quote source",
            "enum": [
              "reference",
              "broker"
            ],
            "type": "string",
            "description": "Broker bid/ask midpoint, up to8 instruments. Use a new monitorKey when switching mode. No fallback to daily rates.",
            "default": "reference"
          },
          "maxQuoteAgeSeconds": {
            "title": "Maximum live quote age (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Broker only: reject broker timestamps older than this limit. Does not guarantee executable prices or exchange latency.",
            "default": 10
          },
          "referenceMetals": {
            "title": "Daily reference metals",
            "type": "array",
            "description": "Daily, not real-time: CU copper, AL aluminium, NI nickel, ZN zinc, SN tin, PB lead in USD/metric tonne (cash settlement); RH rhodium, IR iridium, RU ruthenium in EUR/gram (processed sales reference). Fixed native units independent of metalUnit. Clear pairs/metals for this list only.  Additional USD/kg packaged investor references: SB BI GA GE HF IN RE TE; DY_OXIDE ND_OXIDE PR_OXIDE TB_OXIDE are compounds, not elemental metals. Grade/purity not stated in source price table. All are daily reference prices, not exchange ticks. China domestic CNY daily forms: W_POWDER, WC_POWDER, W_APT, W_WOLFRAMITE, W_SCHEELITE, CO_POWDER, CO_METAL. Units depend on material: kg, metric tonne, or mtu of contained WO3. No USD conversion.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxReferenceMetalAgeDays": {
            "title": "Maximum daily metal reference age",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Calendar days, 1–10. Applies to current daily references and eligible dated sessions for missing W_POWDER/WC_POWDER. Older observations are rejected; archive dates are preserved, not relabelled as today.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}