{
  "openapi": "3.0.1",
  "info": {
    "title": "FRED Economic Data Fetcher — Time Series & Indicators",
    "description": "Fetch economic time-series data from FRED (Federal Reserve Economic Data, St. Louis Fed) in bulk. Pass a list of FRED series IDs like GDP, UNRATE or CPIAUCSL and get clean date/value rows — with optional date range, units transforms and frequency aggregation. No API key required.",
    "version": "0.1",
    "x-build-id": "bZWIe1o0UW09jVfls"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapeworks~fred-economic-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapeworks-fred-economic-data",
        "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/scrapeworks~fred-economic-data/runs": {
      "post": {
        "operationId": "runs-sync-scrapeworks-fred-economic-data",
        "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/scrapeworks~fred-economic-data/run-sync": {
      "post": {
        "operationId": "run-sync-scrapeworks-fred-economic-data",
        "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": [
          "seriesIds"
        ],
        "properties": {
          "seriesIds": {
            "title": "FRED series IDs",
            "type": "array",
            "description": "One entry per FRED series ID to fetch. Find IDs on fred.stlouisfed.org (the code shown in the series URL/title). Examples: GDP (Gross Domestic Product), UNRATE (Unemployment Rate), CPIAUCSL (Consumer Price Index), FEDFUNDS (Federal Funds Rate), DGS10 (10-Year Treasury Yield), PAYEMS (Nonfarm Payrolls), MORTGAGE30US (30-Year Mortgage Rate). Pass as many as you like — each returns its full history as date/value rows.",
            "items": {
              "type": "string"
            }
          },
          "observationStart": {
            "title": "Start date (optional)",
            "type": "string",
            "description": "Earliest observation date to include, as YYYY-MM-DD (e.g. 2010-01-01). Leave blank for the full available history of each series."
          },
          "observationEnd": {
            "title": "End date (optional)",
            "type": "string",
            "description": "Latest observation date to include, as YYYY-MM-DD (e.g. 2024-12-31). Leave blank to include the most recent data."
          },
          "units": {
            "title": "Units transformation",
            "enum": [
              "lin",
              "chg",
              "ch1",
              "pch",
              "pc1",
              "pca",
              "cch",
              "cca",
              "log"
            ],
            "type": "string",
            "description": "Optional data transformation applied to every value. 'lin' = levels (raw values, default). 'chg' = change, 'ch1' = change from a year ago, 'pch' = percent change, 'pc1' = percent change from a year ago, 'pca' = compounded annual rate of change, 'log' = natural log.",
            "default": "lin"
          },
          "frequency": {
            "title": "Frequency aggregation",
            "enum": [
              "",
              "d",
              "w",
              "bw",
              "m",
              "q",
              "sa",
              "a"
            ],
            "type": "string",
            "description": "Optionally aggregate higher-frequency data to a lower frequency (e.g. monthly to annual). Leave as 'Native' to keep each series' own frequency.",
            "default": ""
          },
          "aggregationMethod": {
            "title": "Aggregation method",
            "enum": [
              "avg",
              "sum",
              "eop"
            ],
            "type": "string",
            "description": "How to combine values when aggregating to a lower frequency (only used when Frequency is set). 'avg' = average, 'sum' = total, 'eop' = end of period.",
            "default": "avg"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Order observations by date, oldest first (ascending) or newest first (descending).",
            "default": "asc"
          },
          "apiKey": {
            "title": "FRED API key (optional)",
            "type": "string",
            "description": "Optional free FRED API key from fredaccount.stlouisfed.org/apikeys. When provided, each row is enriched with series metadata (title, native units, frequency, seasonal adjustment, last-updated date). Without a key the actor still works fully using FRED's public CSV download endpoint — you just get date/value rows without the extra metadata."
          },
          "maxResultsPerSeries": {
            "title": "Max observations per series",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on the number of observations returned for each series ID. Lower this to sample recent data; raise it to pull deep history.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}