{"openapi":"3.1.0","info":{"title":"Quantilica Data API v2","description":"API pública de dados da Quantilica (Fase 2, DaaS Fundação): séries temporais por QSID, observações, lote, catálogo, divulgações, dashboards publicados e alertas/webhooks. Autenticação via `Authorization: Bearer qd_live_...`; respostas trazem cabeçalhos `RateLimit-Limit`, `RateLimit-Remaining` e `RateLimit-Reset`.","version":"2.0.0"},"paths":{"/api/v2/series/{qsid}/observations":{"get":{"summary":"Get Series Observations","description":"Observações com janela (``start``/``end``), DSL de ``ops``, ``as_of``,\nformatos ``json``/``csv``/``parquet`` e paginação por cursor.","operationId":"get_series_observations_api_v2_series__qsid__observations_get","parameters":[{"name":"qsid","in":"path","required":true,"schema":{"type":"string","title":"Qsid"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of"}},{"name":"ops","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ops"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"if-none-match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-None-Match"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"janela":{"summary":"Janela mensal de observações","value":{"data":[{"date":"2025-04-01","value":0.38},{"date":"2025-05-01","value":0.26},{"date":"2025-06-01","value":0.24}],"meta":{"qsid":"bcb:433","unit":"%","periodicity":"monthly","count":3,"total":3,"next_cursor":null}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Observações"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/series/bcb:433/observations?start=2024-01-01&limit=12\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"Python","label":"Python (httpx + polars)","source":"import httpx\nimport polars as pl\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\nresp = httpx.get(\"/api/v2/series/bcb:433/observations?start=2024-01-01&limit=12\", headers=headers)\nresp.raise_for_status()\ndf = pl.DataFrame(resp.json()[\"data\"])\nprint(df.head())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/series/bcb:433/observations?start=2024-01-01&limit=12\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/series/bcb:433/observations?start=2024-01-01&limit=12\""}]}},"/api/v2/series/{qsid}":{"get":{"summary":"Get Series Metadata","description":"Metadados canônicos da série (``describe``, licença, periodicidade).","operationId":"get_series_metadata_api_v2_series__qsid__get","parameters":[{"name":"qsid","in":"path","required":true,"schema":{"type":"string","title":"Qsid"}},{"name":"if-none-match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-None-Match"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"selic":{"summary":"SELIC (bcb:433)","value":{"qsid":"bcb:433","source":"bcb","label":"Taxa de juros - Selic","unit":"% a.a.","periodicity":"daily","license":"public","data_version":"2025-06-01T00:00:00"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Séries"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/series/bcb:433\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"Python","label":"Python (httpx + polars)","source":"import httpx\nimport polars as pl\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\nresp = httpx.get(\"/api/v2/series/bcb:433\", headers=headers)\nresp.raise_for_status()\ndf = pl.DataFrame(resp.json()[\"data\"])\nprint(df.head())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/series/bcb:433\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/series/bcb:433\""}]}},"/api/v2/series:batch":{"post":{"summary":"Batch Series","description":"Resolução em lote (escopo ``export:bulk``; teto por plano — decisão G7).","operationId":"batch_series_api_v2_series_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"lote":{"summary":"Lote com 2 QSIDs (1 inexistente)","value":{"data":[{"qsid":"bcb:433","found":true,"data":[{"date":"2025-06-01","value":0.24}],"meta":{"qsid":"bcb:433","unit":"%"}},{"qsid":"rtn:9.9/INEXISTENTE","found":false}],"meta":{"count":2}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Lote"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.post(\"/api/v2/series:batch\", headers=headers, json={\"qsids\": [\"bcb:433\", \"bcb:433\"], \"start\": \"2024-01-01\"})\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/series:batch\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\n  # corpo JSON: {\"qsids\": [\"bcb:433\", \"bcb:433\"], \"start\": \"2024-01-01\"}\nresp <- req |> req_method(\"POST\") |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -X POST -H \"Authorization: Bearer qd_live_SUA_CHAVE\" -H \"Content-Type: application/json\" -d '{\"qsids\": [\"bcb:433\", \"bcb:433\"], \"start\": \"2024-01-01\"}' \"https://quantilica.com/api/v2/series:batch\""}]}},"/api/v2/search":{"get":{"summary":"Search Catalog","description":"Busca no catálogo unificado de séries (QSID, fonte, unidade).","operationId":"search_catalog_api_v2_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":128,"default":"","title":"Q"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Source"}},{"name":"theme","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Theme"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"busca":{"summary":"Busca por 'selic' no BCB","value":{"data":[{"qsid":"bcb:433","source":"bcb","label":"Taxa de juros - Selic","unit":"% a.a."}],"meta":{"query":"selic","count":1,"total":1}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Catálogo"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/search?q=selic&source=bcb\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/search?q=selic&source=bcb\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/search?q=selic&source=bcb\""}]}},"/api/v2/releases":{"get":{"summary":"List Releases","description":"Divulgações recentes de dados (``core.data_release``, mais recente primeiro).","operationId":"list_releases_api_v2_releases_get","parameters":[{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Source"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"feed":{"summary":"Feed de divulgações do BCB","value":{"data":[{"id":42,"source":"bcb","dataset":"433","period":"2025-06","release_date":"2025-06-02T12:00:00+00:00"}],"meta":{"count":1}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Divulgações"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/releases?source=bcb&since=2024-01-01T00:00:00Z\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/releases?source=bcb&since=2024-01-01T00:00:00Z\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/releases?source=bcb&since=2024-01-01T00:00:00Z\""}]}},"/api/v2/dashboards/{slug}":{"get":{"summary":"Get Dashboard Metadata","description":"Metadados de um painel publicado (escopo ``read:dashboards``).","operationId":"get_dashboard_metadata_api_v2_dashboards__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"painel":{"summary":"Painel publicado","value":{"slug":"ipca-mensal","title":"IPCA mensal","visibility":"public","spec_version":1,"qsids":["bcb:433"]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Dashboards"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/dashboards/ipca-mensal\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/dashboards/ipca-mensal\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/dashboards/ipca-mensal\""}]}},"/api/v2/dashboards/{slug}/data":{"get":{"summary":"Get Dashboard Data","description":"Dados resolvidos de um painel publicado (spec renderizada).","operationId":"get_dashboard_data_api_v2_dashboards__slug__data_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"painel":{"summary":"Painel publicado","value":{"slug":"ipca-mensal","title":"IPCA mensal","visibility":"public","spec_version":1,"qsids":["bcb:433"]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Dashboards"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/dashboards/ipca-mensal/data\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/dashboards/ipca-mensal/data\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/dashboards/ipca-mensal/data\""}]}},"/api/v2/alerts":{"post":{"summary":"Create Alert","description":"Cria uma regra de alerta (escopo ``alerts:write``).","operationId":"create_alert_api_v2_alerts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"alerta":{"summary":"Regra de alerta acima do limiar","value":{"qsid":"bcb:433","condition":"above","threshold":10.0,"channel":"webhook"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Alertas"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.post(\"/api/v2/alerts\", headers=headers, json={\"qsid\": \"bcb:433\", \"condition\": \"above\", \"threshold\": 10.0, \"channel\": \"webhook\", \"destination\": \"https://exemplo.com/hook\"})\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/alerts\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\n  # corpo JSON: {\"qsid\": \"bcb:433\", \"condition\": \"above\", \"threshold\": 10.0, \"channel\": \"webhook\", \"destination\": \"https://exemplo.com/hook\"}\nresp <- req |> req_method(\"POST\") |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -X POST -H \"Authorization: Bearer qd_live_SUA_CHAVE\" -H \"Content-Type: application/json\" -d '{\"qsid\": \"bcb:433\", \"condition\": \"above\", \"threshold\": 10.0, \"channel\": \"webhook\", \"destination\": \"https://exemplo.com/hook\"}' \"https://quantilica.com/api/v2/alerts\""}]}},"/api/v2/webhooks":{"post":{"summary":"Create Webhook","description":"Cria um webhook de alerta com secret HMAC (escopo ``webhooks:manage``).\n\nO ``secret`` é exibido uma única vez na resposta (mesmo contrato do P50).","operationId":"create_webhook_api_v2_webhooks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{},"examples":{"alerta":{"summary":"Regra de alerta acima do limiar","value":{"qsid":"bcb:433","condition":"above","threshold":10.0,"channel":"webhook"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Alertas"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.post(\"/api/v2/webhooks\", headers=headers, json={\"url\": \"https://exemplo.com/hook\", \"qsid\": \"bcb:433\", \"condition\": \"above\"})\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/webhooks\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\n  # corpo JSON: {\"url\": \"https://exemplo.com/hook\", \"qsid\": \"bcb:433\", \"condition\": \"above\"}\nresp <- req |> req_method(\"POST\") |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -X POST -H \"Authorization: Bearer qd_live_SUA_CHAVE\" -H \"Content-Type: application/json\" -d '{\"url\": \"https://exemplo.com/hook\", \"qsid\": \"bcb:433\", \"condition\": \"above\"}' \"https://quantilica.com/api/v2/webhooks\""}]}},"/api/v2/products/inflation-feed/latest":{"get":{"summary":"Get Latest Reading","description":"Leitura mais recente consolidada de IPCA/IPCA-15.","operationId":"get_latest_reading_api_v2_products_inflation_feed_latest_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Produtos"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/products/inflation-feed/latest\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/products/inflation-feed/latest\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/products/inflation-feed/latest\""}]}},"/api/v2/products/inflation-feed/history":{"get":{"summary":"Get Reading History","description":"Histórico das divulgações (núcleos, difusão e surpresa Focus).","operationId":"get_reading_history_api_v2_products_inflation_feed_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Produtos"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/products/inflation-feed/history\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/products/inflation-feed/history\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/products/inflation-feed/history\""}]}},"/api/v2/products/inflation-feed/subscribe":{"post":{"summary":"Subscribe Inflation Feed","description":"Registra webhook de entrega em tempo quase real (secret exibido 1x).","operationId":"subscribe_inflation_feed_api_v2_products_inflation_feed_subscribe_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationSubscribeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Produtos"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.post(\"/api/v2/products/inflation-feed/subscribe\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/products/inflation-feed/subscribe\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_method(\"POST\") |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -X POST -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/products/inflation-feed/subscribe\""}]}},"/api/v2/products/inflation-feed/latency-report":{"get":{"summary":"Get Latency Report","description":"Latência das divulgações (``released_at`` → ``delivered_at``, em ms).\n\nPercentis p50/p95/p99 pelo método *nearest-rank* determinístico sobre as\nentregas confirmadas (2xx) do produto.","operationId":"get_latency_report_api_v2_products_inflation_feed_latency_report_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Produtos"],"x-codeSamples":[{"lang":"Python","label":"Python (httpx)","source":"import httpx\n\nAPI_KEY = \"qd_live_SUA_CHAVE\"\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresp = httpx.get(\"/api/v2/products/inflation-feed/latency-report\", headers=headers)\nresp.raise_for_status()\nprint(resp.json())"},{"lang":"R","label":"R (httr2)","source":"library(httr2)\n\nreq <- request(\"https://quantilica.com\") |>\n  req_url_path(\"/api/v2/products/inflation-feed/latency-report\") |>\n  req_auth_bearer_token(\"qd_live_SUA_CHAVE\")\nresp <- req |> req_perform()\nresp |> resp_body_json() |> str()"},{"lang":"cURL","label":"cURL","source":"curl -s -H \"Authorization: Bearer qd_live_SUA_CHAVE\" \"https://quantilica.com/api/v2/products/inflation-feed/latency-report\""}]}}},"components":{"schemas":{"AlertCreateRequest":{"properties":{"qsid":{"type":"string","maxLength":256,"minLength":1,"title":"Qsid"},"condition":{"type":"string","enum":["above","below","crosses_above","crosses_below"],"title":"Condition"},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"cooldown_minutes":{"type":"integer","maximum":10080.0,"minimum":1.0,"title":"Cooldown Minutes","default":60},"channel":{"type":"string","enum":["email","webhook"],"title":"Channel","default":"webhook"},"destination":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Destination"}},"type":"object","required":["qsid","condition"],"title":"AlertCreateRequest","description":"Corpo de ``POST /alerts`` (nó P53)."},"BatchRequest":{"properties":{"qsids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Qsids"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},"type":"object","required":["qsids"],"title":"BatchRequest","description":"Corpo de ``POST /series:batch`` (nó P53: limite é verificado no handler)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InflationSubscribeRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"}},"type":"object","required":["url"],"title":"InflationSubscribeRequest","description":"Corpo de ``POST /products/inflation-feed/subscribe``."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookCreateRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"qsid":{"type":"string","maxLength":256,"minLength":1,"title":"Qsid"},"condition":{"type":"string","enum":["above","below","crosses_above","crosses_below"],"title":"Condition","default":"above"},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"cooldown_minutes":{"type":"integer","maximum":10080.0,"minimum":1.0,"title":"Cooldown Minutes","default":60}},"type":"object","required":["url","qsid"],"title":"WebhookCreateRequest","description":"Corpo de ``POST /webhooks`` (nó P53)."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"qd_live_...","description":"Credencial de cliente da API (`qd_live_...` em produção, `qd_test_...` em homologação). Envie como `Authorization: Bearer qd_live_...`."}}},"tags":[{"name":"Séries","description":"Metadados canônicos de séries temporais (QSID). Cada série é identificada por uma QSID do tipo `fonte:id` (ex.: `bcb:433` para a SELIC, `sidra.curated:ipca-mensal`). Respostas incluem `label`, `unit`, `periodicity`, `license` e `data_version`, com ETag/`If-None-Match` → 304."},{"name":"Observações","description":"Observações (pontos `date`/`value`) de uma série com recorte por janela (`start`/`end`), ponto-no-tempo (`as_of`), DSL de transformações (`ops=yoy_pct, rolling_sum(window=6), scale(k=10)`), formatos `json`/`csv`/`parquet` e paginação por cursor opaco."},{"name":"Lote","description":"Resolução em lote de até 100 QSIDs por requisição (`POST /series:batch`; `batch_max_qsids` por plano — 10 no free, decidido G7). Requer escopo `export:bulk`; séries inexistentes retornam `found: false` sem abortar o lote."},{"name":"Catálogo","description":"Busca unificada no catálogo de séries (`GET /search`) através das fontes BCB-SGS, RTN, SIDRA curada e Tesouro Direto, com filtros `q`/`source`/`theme` e paginação `limit`/`offset`."},{"name":"Divulgações","description":"Feed de divulgações de dados (`GET /releases`, tabela `core.data_release`) filtrável por `source` e `since` (ISO datetime), ordenado do mais recente para o mais antigo."},{"name":"Dashboards","description":"Painéis publicados da plataforma: metadados (`GET /dashboards/{slug}`, escopo `read:dashboards`) e dados resolvidos da spec declarativa (`GET /dashboards/{slug}/data`)."},{"name":"Alertas","description":"Regras de alerta (`POST /alerts`, escopo `alerts:write`) e webhooks com secret HMAC (`POST /webhooks`, escopo `webhooks:manage`, exibido uma única vez). URLs locais/privadas são bloqueadas (proteção anti-SSRF)."},{"name":"Produtos","description":"Produtos comerciais de dados (`products:<produto>`, escopo por produto). **Feed de Inflação em Tempo Quase Real** (P62): leitura consolidada IPCA/IPCA-15 (`/products/inflation-feed/latest` e `/history`), assinatura de webhook de baixa latência (`/products/inflation-feed/subscribe`, escopo `products:inflation-feed`) e relatório de latência p50/p95/p99 (``/products/inflation-feed/latency-report``)."}],"security":[{"bearerAuth":[]}],"servers":[{"url":"https://quantilica.com","description":"Produção"},{"url":"http://localhost:8000","description":"Desenvolvimento local"}],"externalDocs":{"description":"Portal do desenvolvedor","url":"/developers"}}