{
  "openapi": "3.0.1",
  "info": {
    "title": "Commodity Prices API - Metals, Lithium, Agriculture, Forest",
    "description": "Commodity price assessments and history from the Fastmarkets Physical Prices and Market Data APIs: base and steel metals, lithium, cobalt and battery raw materials, agriculture and forest products. Low, mid, high, forecasts, instruments, references. Bring your own key.",
    "version": "0.1",
    "x-build-id": "t9EvNytSZiSdlgx82"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~metals-commodity-prices-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-metals-commodity-prices-api",
        "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~metals-commodity-prices-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-metals-commodity-prices-api",
        "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~metals-commodity-prices-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-metals-commodity-prices-api",
        "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 run",
            "enum": [
              "physicalPrices",
              "physicalHistory",
              "physicalInstruments",
              "references",
              "marketPrices",
              "marketHistory",
              "marketInstruments"
            ],
            "type": "string",
            "description": "Physical prices returns the latest (or given date) price assessment for each symbol. Physical price history returns a time series over a date range, with optional forecasts and revisions. Physical instruments lists instrument details (all your subscription covers when no symbols are given). Reference data lists currencies, units, price calculation types, incoterms, commodities or sources. The three market data modes read the Fastmarkets Market Data API: latest prices, price history and instruments for exchange and market instruments such as XL-CA-FRC.O.",
            "default": "physicalPrices"
          },
          "symbols": {
            "title": "Symbols",
            "type": "array",
            "description": "Fastmarkets instrument symbols, one per line, up to 500 a run, sent 25 to a request. Physical Prices symbols look like MB-AL-0012; Market Data symbols look like XL-CA-FRC.O. Required for the price modes; leave empty in an instruments mode to list everything your subscription covers.",
            "items": {
              "type": "string"
            }
          },
          "dates": {
            "title": "Dates",
            "type": "array",
            "description": "Physical prices only. Optional YYYY-MM-DD dates, one per line. Leave empty for the latest available price.",
            "items": {
              "type": "string"
            }
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Physical price history only, required. Start of the range as YYYY-MM-DD, such as 2026-01-01."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "Physical price history only. End of the range as YYYY-MM-DD. Leave empty for up to the latest price."
          },
          "priceCalculationType": {
            "title": "Price calculation type",
            "enum": [
              "None",
              "WeightedAverageOfTrades",
              "WeeklyAverage",
              "MonthlyAverage",
              "QuarterlyAverage",
              "YearlyAverage"
            ],
            "type": "string",
            "description": "Physical prices and history. None returns the assessed value; the others return Fastmarkets' calculated averages where the instrument supports them.",
            "default": "None"
          },
          "averageToDateStrategy": {
            "title": "Average to date",
            "enum": [
              "exclude",
              "explicit",
              "include"
            ],
            "type": "string",
            "description": "Physical prices and history. Whether averages for a period still in progress are returned.",
            "default": "exclude"
          },
          "calendarType": {
            "title": "Calendar type",
            "enum": [
              "AssessmentDays",
              "Weekdays"
            ],
            "type": "string",
            "description": "Physical price history only. Optional. Weekdays with carry forward fills days without an assessment."
          },
          "carryForward": {
            "title": "Carry forward",
            "type": "boolean",
            "description": "Physical price history only. Carries the last assessed price forward over days without a new one.",
            "default": false
          },
          "revisionHistory": {
            "title": "Include revision history",
            "type": "boolean",
            "description": "Physical price history only. Adds previous revisions of each price (kept under record).",
            "default": false
          },
          "forecastType": {
            "title": "Forecast type",
            "enum": [
              "F24M"
            ],
            "type": "string",
            "description": "Physical price history only. Optional. Adds Fastmarkets forecast price points as rows with recordType forecast, where your subscription includes forecasts."
          },
          "fields": {
            "title": "Optional fields",
            "type": "array",
            "description": "Physical modes. Optional extra fields, one per line, such as pricingRationale, assessmentPeriod, appraisalPrice, midChangeSincePrevious or midChangeSincePreviousProportion.",
            "items": {
              "type": "string"
            }
          },
          "targetCurrency": {
            "title": "Target currency",
            "type": "string",
            "description": "Physical prices and history. Optional ISO 4217 code, such as USD or EUR, to convert every price at the assessment date rate. Run Reference data with Currency for the supported codes."
          },
          "targetUnitOfMeasure": {
            "title": "Target unit of measure",
            "type": "string",
            "description": "Physical prices and history. Optional unit code, such as Tonne, to convert every price. Run Reference data with UnitOfMeasure for the supported codes."
          },
          "referenceTypes": {
            "title": "Reference types",
            "type": "array",
            "description": "Reference data only. The reference lists to return.",
            "items": {
              "type": "string",
              "enum": [
                "Currency",
                "UnitOfMeasure",
                "PriceCalculationType",
                "Incoterm",
                "Commodity",
                "Source"
              ],
              "enumTitles": [
                "Currency",
                "Unit of measure",
                "Price calculation type",
                "Incoterm",
                "Commodity",
                "Source (publication)"
              ]
            },
            "default": [
              "Commodity"
            ]
          },
          "marketFields": {
            "title": "Market data fields",
            "type": "array",
            "description": "Market data prices and history. The price fields to return, such as bid, mid and ask. Fields an instrument does not define are left out by Fastmarkets.",
            "default": [
              "bid",
              "mid",
              "ask"
            ],
            "items": {
              "type": "string"
            }
          },
          "startTime": {
            "title": "Start time",
            "type": "string",
            "description": "Market data price history only. Optional ISO-8601 date or date-time. Leave empty to count back from now."
          },
          "interval": {
            "title": "Interval",
            "type": "string",
            "description": "Market data price history only. A span as days:hours:minutes:seconds, such as 30:00:00:00 for 30 days. A negative span with a start time reads back from it. Give this or the count, not both.",
            "default": "30:00:00:00"
          },
          "count": {
            "title": "Count",
            "minimum": -10000,
            "maximum": 10000,
            "type": "integer",
            "description": "Market data price history only. Optional number of prices instead of an interval. Fastmarkets marks this parameter for removal in a future version."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing. A rate limit answer is waited out and retried; a used up allowance ends the run.",
            "default": 60
          },
          "serviceName": {
            "title": "Service name",
            "type": "string",
            "description": "Your own Fastmarkets API service name, issued by Fastmarkets with the service key. Stored as a secret. You can instead set the DATA_API_SERVICE_NAME environment secret."
          },
          "apiKey": {
            "title": "Service key",
            "type": "string",
            "description": "The service key that goes with the service name. The pair is exchanged at auth.fastmarkets.com for an access token, reused for the whole run. You can paste a ready access token here instead and leave the service name empty. Stored as a secret, sent only to Fastmarkets, 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}