API Documentation

Welcome to the official Feriados API documentation. Our REST API provides accurate data on national, state, and municipal holidays in Brazil. All endpoints return responses in JSON format and use standard HTTP status codes.

Interactive API Reference

Explore our endpoints in real-time with our interactive documentation. Test requests directly from your browser and validate your integration instantly.

Open API Reference
Base URL:
https://feriadosapi.com

Choose example code language

Usage Limits & Plans

Feriados API offers different levels of service depending on your plan. Understanding the limits is fundamental to ensuring your integration stability.

Free Plan

  • Access to National and State holidays
  • Access to all 27 state capital cities
  • Rate Limit: 60 requests per minute

Paid Plans

  • Access to all 5,571 municipalities
  • Date verification & advanced endpoints
  • Developer: Rate Limit of 60 req/min
  • Starter (120 req/min) & Professional (1,000 req/min)
  • Starter (3 endpoints) & Professional (10 endpoints): Real-time Webhooks
About API Rate Limits: The 60 req/min limit applies to Free and Developer plans. For higher volume and throughput in production, the Starter plan offers 120 req/min and Professional provides 1,000 req/min. See Plans and Pricing.

Authentication

All requests must include your API key in the Authorization header. You can obtain your key in the Dashboard.

Don't have an API key yet?

Create your free account right now and start integrating.

Create Free Account
Header example
bash
Authorization: Bearer your_token_here

Pagination & Filters

The API supports pagination via query parameters on listing endpoints. Additionally, all endpoints return useful response metadata inside the meta object.

Query Parameters

ParameterDescriptionDefault
pageCurrent page number1
limitItems per page (max 100)50
anoFilters holidays by year (e.g. 2026)All
facultativosIf true, includes optional holidaysfalse

National Holidays

GETFree

Returns all national holidays for a given year.

Endpoint

/api/v1/feriados/nacionais?ano=2026
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/feriados/nacionais?ano=2026" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Response Example

json
{
"tipo": "NACIONAL",
"ano": "2026",
"feriados": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"data": "01/01/2026",
"nome": "Confraternização Universal",
"tipo": "NACIONAL"
},
{
"id": "123e4567-e89b-12d3-a456-426614174001",
"data": "25/12/2026",
"nome": "Natal",
"tipo": "NACIONAL"
}
],
"meta": {
"total": 12,
"page": 1,
"per_page": 50,
"total_pages": 1
}
}

State Holidays

GETFree

Returns state holidays (including national ones) for a specific state (UF — Unidade da Federação, the 2-letter Brazilian state code like SP or RJ).

Endpoint

/api/v1/feriados/estado/{uf}?ano=2026
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/feriados/estado/SP?ano=2026" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Response Example (SP)

json
{
"uf": "SP",
"ano": "2026",
"feriados": [
{
"id": "...",
"data": "09/07/2026",
"nome": "Revolução Constitucionalista",
"tipo": "ESTADUAL"
}
],
"meta": {
"total": 15,
"page": 1,
"per_page": 50,
"total_pages": 1
}
}

Municipal Holidays

GETCapitals FreeOthers Consume Quota

Returns all holidays (municipal, state, and national) for a specific city by its 7-digit IBGE code (Brazil's standardized municipal census code, equivalent to US FIPS or French INSEE codes).

Free for the 27 state capitals. Other municipalities consume 1 unit of monthly quota.

Endpoint

/api/v1/feriados/cidade/{ibge}?ano=2026
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/feriados/cidade/3550308?ano=2026" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Response Example (São Paulo - 3550308)

json
{
"cidade": {
"ibge": 3550308,
"nome": "São Paulo",
"uf": "SP"
},
"ano": "2026",
"feriados": [
{
"id": "...",
"data": "25/01/2026",
"nome": "Aniversário de São Paulo",
"tipo": "MUNICIPAL"
}
],
"meta": {
"total": 18,
"page": 1,
"per_page": 50,
"total_pages": 1
}
}

Check Date

GETConsumes Quota

Checks whether a specific date is a holiday. Returns 404 if not.

Attention: This endpoint is available exclusively on paid plans and consumes 1 unit of your monthly quota per query.

Endpoint

/api/v1/feriados/data/{ano-mes-dia}
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/feriados/data/2026-12-25" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Banking Holidays

The API includes the official banking calendar based on CMN Resolution 4,880/2020 and the FEBRABAN calendar. All endpoints return the bancario (boolean) field indicating whether it is a banking holiday. Includes all national holidays plus optional dates when banks are closed: Carnival (Mon/Tue), Ash Wednesday (open after noon), Corpus Christi, and New Year's Eve (Dec 31).

Filter banking holidays only

Add ?bancarios=true to any existing endpoint to return only banking holidays.

bash
GET /api/v1/feriados/nacionais?ano=2026&bancarios=true

Dedicated Endpoint: List banking holidays

Free
json
GET /api/v1/feriados/bancarios?ano=2026

Optional parameters: uf (2-letter state code), ibge (7-digit municipal code), facultativos.

Check banking business day

Free
json
GET /api/v1/feriados/dia-util-bancario/2026-02-16

Returns whether a date is a banking business day. If not, provides the reason and next business day. Date format: YYYY-MM-DD.

List States

GETFree

Returns the list of all 27 Brazilian states and federal districts (UFs) with their abbreviations and names.

Endpoint

/api/v1/estados
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/estados" \
-H "Authorization: Bearer YOUR_API_TOKEN"

List Municipalities

GETFree

Returns the complete list of all 5,571 Brazilian municipalities and their official IBGE geographic codes.

Endpoint

/api/v1/municipios
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/municipios" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Search Municipality

GETFree

Returns data for a specific municipality by its 7-digit IBGE geographic census code.

Endpoint

/api/v1/municipio/{ibge}
Example (curl)
bash
curl -X GET "https://feriadosapi.com/api/v1/municipio/3550308" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Glossary & Models

Holiday Types

  • NACIONALHoliday valid throughout all of Brazil.
  • ESTADUALHoliday valid only in a specific state (UF — 2-letter state abbreviation like SP, RJ, MG).
  • MUNICIPALHoliday valid only in a specific city (e.g. City Anniversary, local religious observances).
  • FACULTATIVOOptional holiday (e.g. Carnival, Corpus Christi in some locations).

Holiday Object

json
{
"id": "UUID", // Unique identifier
"data": "DD/MM/YYYY", // Official date
"nome": "String", // Holiday name
"tipo": "Enum", // NACIONAL | ESTADUAL | MUNICIPAL | FACULTATIVO
"descricao": "String", // Historical context
"uf": "SP", // (Optional) State UF
"codigo_ibge": 12345, // (Optional) City IBGE
"bancario": true // Banking holiday (FEBRABAN)
}

Holiday Webhooks

Starter & Professional

Receive automatic HTTP POST notifications on your server whenever a holiday is created, updated, or removed from the Feriados API database. Eliminate unnecessary polling loops and keep your calendars, scheduling, and payroll systems synchronized in real time.

Plans & Capacity

Starter plan includes up to 3 active endpoints. Professional includes up to 10 endpoints with detailed telemetry.

Granular Filters

Filter dispatches per endpoint by holiday types (National, State, Municipal, Optional), specific states (UFs), or banking-only.

Real-Time Dispatch

Events are dispatched immediately via HTTP POST with automatic exponential backoff retries.

Available Events

EventDescriptionTrigger
feriado.createdFired when a new official holiday or commemorative date is published and stored in the database.New holiday entry
feriado.updatedFired when an existing holiday receives updates (official date revision, status changes, legal decree info).Modification or decree revision
feriado.deletedFired when a holiday or decree is revoked or removed from the official calendar.Revocation or deletion
pingTest dispatch initiated manually via Dashboard to verify endpoint reachability, TLS handshake, and signature calculation.Dashboard test button

Sample Webhook Payload (JSON)

HTTP POST Payload (application/json)
json
{
"id": "deliv_01j9a8b7c6d5e4f3a2b1c0d9e8",
"event": "feriado.created",
"created_at": "2026-09-08T18:30:00.000Z",
"data": {
"id": "a3b8c7d6-e5f4-4a3b-8c7d-6e5f4a3b8c7d",
"nome": "Dia da Consciência Negra",
"data": "2026-11-20",
"tipo": "NACIONAL",
"descricao": "Feriado Nacional oficializado pela Lei nº 14.759/2023.",
"uf": null,
"codigo_ibge": null,
"bancario": true
}
}

Cryptographic Signature & Verification (HMAC-SHA256)

To ensure incoming webhook requests genuinely originate from Feriados API and have not been tampered with, every dispatch includes security headers containing a cryptographic signature signed with your endpoint's secret key (whsec_...).

HTTP Headers Included

HeaderFormat / ExampleDescription
X-Feriados-Signaturet=1788894200,v1=a1b2c3d4e5f6...Contains the UNIX timestamp t and the hexadecimal HMAC-SHA256 signature v1.
X-Feriados-Deliverydeliv_01j9a8b7c6d5e4f3a2b1c0d9e8Unique delivery identifier for tracing, deduplication, and manual replay inspection.
X-Feriados-Timestamp1788894200Unix timestamp (in seconds) indicating when the webhook request was assembled.
Content-Typeapplication/json; charset=utf-8UTF-8 encoded JSON payload

Step-by-Step Verification Protocol

  1. Extract timestamp and signature: Parse the X-Feriados-Signature header to separate t and v1.
  2. Prevent Replay Attacks: Compute Math.abs(Date.now() / 1000 - t). If the difference exceeds 300 seconds (5 minutes), reject the request.
  3. Prepare signed payload: Concatenate t + "." + rawBody. Warning: you MUST use the raw unparsed request body string/buffer.
  4. Calculate HMAC-SHA256: Hash the concatenated string using your endpoint secret (whsec_...) with SHA-256.
  5. Timing-safe comparison: Use crypto.timingSafeEqual (Node.js) or hmac.compare_digest (Python) to mitigate timing attacks.

Signature Verification Example

TypeScript / Node.js (Express)
verify-webhook.ts
typescript
import crypto from 'crypto';
import express, { Request, Response } from 'express';
const app = express();
// Importante: capture o corpo bruto (Buffer) para validação HMAC
app.use(express.raw({ type: 'application/json' }));
const WEBHOOK_SECRET = process.env.FERIADOS_WEBHOOK_SECRET!; // whsec_...
function verifyWebhookSignature(
rawBody: Buffer,
signatureHeader: string,
secret: string,
toleranceSeconds = 300
): boolean {
// 1. Extrair t e v1
const elements = signatureHeader.split(',');
const timestampPart = elements.find((el) => el.startsWith('t='));
const signaturePart = elements.find((el) => el.startsWith('v1='));
if (!timestampPart || !signaturePart) return false;
const timestamp = parseInt(timestampPart.substring(2), 10);
const signature = signaturePart.substring(3);
// 2. Prevenir replay attacks (janela de 5 minutos)
const currentTime = Math.floor(Date.now() / 1000);
if (Math.abs(currentTime - timestamp) > toleranceSeconds) {
return false;
}
// 3. Montar payload assinado: `${timestamp}.${rawBody}`
const signedPayload = `${timestamp}.${rawBody.toString('utf-8')}`;
// 4. Calcular HMAC-SHA256
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
// 5. Comparar de forma segura contra timing attacks
const expectedBuffer = Buffer.from(expectedSignature, 'utf-8');
const actualBuffer = Buffer.from(signature, 'utf-8');
if (expectedBuffer.length !== actualBuffer.length) return false;
return crypto.timingSafeEqual(expectedBuffer, actualBuffer);
}
app.post('/api/webhook-feriados', (req: Request, res: Response) => {
const signatureHeader = req.headers['x-feriados-signature'] as string;
if (!signatureHeader || !verifyWebhookSignature(req.body, signatureHeader, WEBHOOK_SECRET)) {
return res.status(401).json({ error: 'Assinatura inválida' });
}
const payload = JSON.parse(req.body.toString('utf-8'));
console.log('Evento recebido com sucesso:', payload.event, payload.data);
// Retorne status 2xx rapidamente (< 8s)
return res.status(200).json({ received: true });
});
Python (FastAPI)
verify_webhook.py
python
import os
import time
import hmac
import hashlib
from fastapi import FastAPI, Request, HTTPException, status
app = FastAPI()
WEBHOOK_SECRET = os.environ.get("FERIADOS_WEBHOOK_SECRET") # whsec_...
def verify_signature(raw_body: bytes, header_val: str, secret: str, tolerance: int = 300) -> bool:
if not header_val or not secret:
return False
parts = dict(item.split("=", 1) for item in header_val.split(",") if "=" in item)
timestamp_str = parts.get("t")
signature = parts.get("v1")
if not timestamp_str or not signature:
return False
# 1. Prevenir Replay Attack (5 minutos)
timestamp = int(timestamp_str)
if abs(time.time() - timestamp) > tolerance:
return False
# 2. Montar string assinada: timestamp.raw_body
signed_payload = f"{timestamp}.".encode("utf-8") + raw_body
# 3. Calcular HMAC-SHA256
expected_sig = hmac.new(
secret.encode("utf-8"),
signed_payload,
hashlib.sha256
).hexdigest()
# 4. Comparação em tempo constante
return hmac.compare_digest(expected_sig, signature)
@app.post("/api/webhook-feriados")
async def handle_webhook(request: Request):
sig_header = request.headers.get("x-feriados-signature")
body = await request.body()
if not sig_header or not verify_signature(body, sig_header, WEBHOOK_SECRET):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Assinatura inválida"
)
data = await request.json()
print(f"Evento recebido com sucesso: {data['event']}")
# Retorne status 2xx rapidamente (< 8s)
return {"received": True}

Retry Policy, Circuit Breaker & Retention

Our delivery engine uses a fault-tolerant architecture featuring scheduled exponential backoff retries and an automatic circuit breaker to protect your endpoints from cascading overloads.

Response Expectation & Timeout

Your webhook receiver must return an HTTP status code in the 2xx range (200, 201, 202, or 204) within 8 seconds.

Redirects (3xx), Client Errors (4xx), Server Errors (5xx), or timeouts beyond 8s are marked as failed attempts and trigger the retry schedule.

Automatic Circuit Breaker

If an endpoint accumulates 20 consecutive delivery failures, it is temporarily paused to protect both your infrastructure and our queue.

A warning badge appears on your Dashboard. You can re-enable the endpoint with a single click as soon as your server stabilizes.

Exponential Backoff Schedule (6 Total Attempts)

AttemptInterval / DelayCumulative TimeBehavior
AttemptT + 0InstantaneousImmediate dispatch upon event occurrence
Attempt~5 minT + 5mFirst retry
Attempt~30 minT + 35mSecond retry with backoff
Attempt~2 horasT + 2h 35mExtended backoff interval
Attempt~8 horasT + 10h 35mAllows overnight recovery
Attempt~24 horasT + ~34hFinal automated attempt before marking permanent failure

30-Day Delivery Logs Retention

Inspect detailed HTTP status codes, latency timings (ms), sent payload bodies, and error traces for every dispatch directly in your Dashboard.

Manual Resend On-Demand

Even if all automated retries were exhausted, you can manually resend any delivery from the log viewer with 1 click once your server is back online.

AI Agents via MCP

Exclusive MCP Server Portal

To see advanced setup options for VS Code, Copilot, Cursor, and full framework integration guides, visit our dedicated Model Context Protocol portal.

Access mcp.feriadosapi.com

In addition to our classic REST API, Feriados API is Brazil's First Model Context Protocol (MCP) Server for Holidays. Provide precise local date context to AI Agents built on OpenAI, Gemini, Claude, Manus, and more.

1. Remote Connection (Recommended)

Configure via URL by connecting the API in your client.

https://mcp.feriadosapi.com/api/mcp?apiKey=YOUR_KEY

2. Local Connection (npx)

Run directly via CLI (Node.js/npm).

npx -y @feriados-api/mcp-server

Connect Your Application

Example: Configuration File (MCP Clients & Frameworks)
json
{
"mcpServers": {
"feriadosapi": {
"url": "https://mcp.feriadosapi.com/api/mcp?apiKey=YOUR_API_KEY"
}
}
}

Real-World AI Use Cases:

  • Logistics Agent: "Calculate the final delivery date for Salvador, ignoring weekends, national holidays, and Bahia state holidays."
  • Travel Agent: "Create an itinerary in Ouro Preto for next week. Avoid scheduling attractions on Tuesday if it is a municipal holiday."
  • HR/Payroll Agent: "Generate this month's timecard summary, identifying all overtime worked during bridges and optional holidays for the São Paulo branch."
  • Financial Assistant: "Check this invoice batch and advance bank payment for those whose due dates fall on holidays."

Tools Injected into Agent

buscar_feriadosFull search with flexible filters (date, type, UF, IBGE, year, banking).
feriados_nacionaisList of all national holidays.
feriados_por_estadoSearch state holidays using state UF code.
feriados_por_cidadeSearch municipal holidays using IBGE code.
feriados_bancariosList FEBRABAN banking holidays. Filters: year, UF, IBGE.
verificar_dia_util_bancarioCheck if a date is a banking business day (reason + next business day).
verificar_dataCheck if a date (YYYY-MM-DD) is a holiday.
listar_estadosList states and UFs for context.
buscar_municipiosSearch IBGE code for cities.