{
  "openapi": "3.0.1",
  "info": {
    "title": "Banco Central do Brasil SGS Scraper",
    "description": "Pull Brazilian economic time series straight from the Banco Central do Brasil SGS. Track the Selic rate, IPCA inflation, USD/BRL exchange rates, and credit aggregates by code or date range. Each observation returns series code, name, date, and value for models and macro research.",
    "version": "0.1",
    "x-build-id": "dkJjXpCUP2gF3SLqd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~banco-central-brasil-sgs-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-banco-central-brasil-sgs-scraper",
        "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/parseforge~banco-central-brasil-sgs-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-banco-central-brasil-sgs-scraper",
        "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/parseforge~banco-central-brasil-sgs-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-banco-central-brasil-sgs-scraper",
        "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": {
          "seriesCodes": {
            "title": "Series",
            "type": "array",
            "description": "One or more Banco Central do Brasil SGS series to fetch. Pick from the curated list, or add any other numeric code via Custom Series Codes below.",
            "items": {
              "type": "string",
              "enum": [
                "432",
                "11",
                "4189",
                "433",
                "13522",
                "189",
                "190",
                "188",
                "1",
                "10813",
                "21619",
                "20539",
                "20542",
                "20786",
                "1207",
                "24364",
                "4380",
                "4385",
                "7326",
                "1619"
              ],
              "enumTitles": [
                "432 — Selic target rate (% per year)",
                "11 — Selic effective rate (% per day)",
                "4189 — Selic accumulated in the month (% per year)",
                "433 — IPCA inflation (monthly % change)",
                "13522 — IPCA accumulated 12 months (%)",
                "189 — IGP-M (monthly % change)",
                "190 — IGP-DI (monthly % change)",
                "188 — INPC (monthly % change)",
                "1 — USD/BRL exchange rate, free, sale (daily)",
                "10813 — USD/BRL exchange rate, commercial, sale (daily)",
                "21619 — EUR/BRL exchange rate, sale (daily)",
                "20539 — Outstanding credit, total financial system (BRL million)",
                "20542 — Outstanding credit to households (BRL million)",
                "20786 — Household debt to income ratio (%)",
                "1207 — Monetary base (BRL thousand)",
                "24364 — Economic activity index IBC-Br (index)",
                "4380 — GDP monthly current prices (BRL million)",
                "4385 — GDP accumulated 12 months (BRL million)",
                "7326 — Gross general government debt (% of GDP)",
                "1619 — International reserves, total (USD million, daily)"
              ]
            },
            "default": [
              "432",
              "433",
              "1"
            ]
          },
          "customSeriesCodes": {
            "title": "Custom Series Codes",
            "type": "string",
            "description": "Any other SGS series codes, comma separated (for example 24363, 7832). These are added to the series selected above. Find codes at the SGS portal (sgs.bcb.gov.br)."
          },
          "mode": {
            "title": "Fetch Mode",
            "enum": [
              "latest",
              "dateRange"
            ],
            "type": "string",
            "description": "Latest observations pulls the most recent records per series. Date range pulls every observation between the two dates below.",
            "default": "latest"
          },
          "lastN": {
            "title": "Latest Count Per Series",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "When Fetch Mode is Latest observations, how many of the most recent records to pull from each series."
          },
          "startDate": {
            "title": "Start Date",
            "type": "string",
            "description": "When Fetch Mode is Date range, the first day to include, in DD/MM/YYYY format (for example 01/01/2024)."
          },
          "endDate": {
            "title": "End Date",
            "type": "string",
            "description": "When Fetch Mode is Date range, the last day to include, in DD/MM/YYYY format (for example 01/06/2024)."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}