nfce.fazenda.sp.gov.br APIwww.nfce.fazenda.sp.gov.br ↗
Retrieve structured data from São Paulo state NFC-e fiscal receipts via the get_receipt endpoint. Returns store info, itemized purchases, totals, and payment methods.
curl -X GET 'https://api.parse.bot/scraper/ebd36a87-7ee2-4562-9f4a-ee681fd8aa55/get_receipt?access_key=35260147508411092689651270000202991072525880%7C3%7C1' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace nfce-fazenda-sp-gov-br-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: NFC-e SP Receipt API — fetch and inspect a Brazilian electronic receipt."""
from parse_apis.NFC_e_SP_Receipt_API import NfceSP, NotFoundError
client = NfceSP()
# Fetch a receipt by its QR code access key
receipt = client.receipts.get(
access_key="35260147508411092689651270000202991072525880|3|1"
)
# Inspect store info
print(f"Store: {receipt.store.name} (CNPJ: {receipt.store.cnpj})")
print(f"Address: {receipt.store.address}")
# List all items with per-item cost
for item in receipt.items:
print(f" {item.name} - Qty: {item.quantity} x {item.unit_price} = {item.total_price}")
# Summary: total items, total spent, payment method
print(f"Item count: {receipt.item_count}")
print(f"Total spent: R$ {receipt.total_spent}")
for pm in receipt.payment_methods:
print(f"Payment: {pm.method} — R$ {pm.amount}")
# Typed error handling for invalid access keys
try:
client.receipts.get(access_key="00000000000000000000000000000000000000000000|1|1")
except NotFoundError as exc:
print(f"Receipt not found: {exc}")
print("exercised: receipts.get / store fields / items iteration / payment_methods / error handling")Retrieve a parsed NFC-e receipt by its QR code access key parameter. Returns structured data including store info, itemized purchases with per-item cost, total item count, total amount spent, and payment method. The access_key is the 'p' parameter from the NFC-e QR code URL (typically a 44-digit access key followed by pipe-separated version and type codes).
| Param | Type | Description |
|---|---|---|
| access_keyrequired | string | The 'p' parameter from the NFC-e QR code URL. Format: 44-digit access key followed by pipe-separated fields (e.g. '35260147508411092689651270000202991072525880|3|1'). |
{
"type": "object",
"fields": {
"items": "array of purchased items with name, code, quantity, unit, unit_price, and total_price",
"store": "object containing store name, cnpj, and address",
"access_key": "string with formatted 44-digit access key",
"item_count": "string with total number of items",
"total_spent": "string with total amount in BRL (e.g. '18,68')",
"emission_date": "string with date/time of emission",
"invoice_number": "string",
"invoice_series": "string",
"payment_methods": "array of payment methods with method name and amount",
"authorization_protocol": "string with authorization protocol number and timestamp"
},
"sample": {
"data": {
"items": [
{
"code": "5113095",
"name": "ACUCAR CRISTALCUC 1K",
"unit": "UN",
"quantity": "1",
"unit_price": "4,19",
"total_price": "4,19"
},
{
"code": "357852",
"name": "ARROZ TIO JOAO T1 2K",
"unit": "UN",
"quantity": "1",
"unit_price": "14,49",
"total_price": "14,49"
}
],
"store": {
"cnpj": "47.508.411/0926-89",
"name": "CIA BRASILEIRA DE DISTRIBUICAO",
"address": "Rua Passeio dos Flamboyants , 000200 , , Parque Faber , SAO CARLOS , SP"
},
"access_key": "3526 0147 5084 1109 2689 6512 7000 0202 9910 7252 5880",
"item_count": "2",
"total_spent": "18,68",
"emission_date": "25/01/2026 16:45:27",
"invoice_number": "20299",
"invoice_series": "127",
"payment_methods": [
{
"amount": "18,68",
"method": "Cartão de Débito"
}
],
"authorization_protocol": "135260570093072 25/01/2026 16:45:28"
},
"status": "success"
}
}About the nfce.fazenda.sp.gov.br API
The nfce.fazenda.sp.gov.br API exposes 1 endpoint — get_receipt — that returns 10 structured fields from São Paulo state electronic consumer fiscal notes (NFC-e), including itemized product lines, store identity, payment methods, and authorization metadata. Pass the access_key parameter extracted from any NFC-e QR code URL to retrieve a fully parsed receipt without manual HTML interpretation.
What the API Returns
The get_receipt endpoint accepts an access_key string — the p parameter found in NFC-e QR code URLs, formatted as a 44-digit fiscal access key followed by pipe-separated control fields. The response includes a store object with the establishment's name, CNPJ (Brazilian tax registration number), and address, alongside emission_date, invoice_number, invoice_series, and authorization_protocol for document traceability.
Itemized Purchase Data
The items array is the core of the response. Each element contains the product name, product code, quantity, unit of measure, unit_price, and total_price — giving you line-level detail for every product on the receipt. item_count summarizes the total number of line items, and total_spent gives the receipt grand total in BRL formatted as a Brazilian decimal string (e.g. '18,68').
Payment Details
The payment_methods array lists each payment instrument used on the transaction along with the amount charged to that method. Receipts paid with multiple methods — such as a split between credit card and cash — will have multiple entries in this array.
Coverage Scope
This API covers public NFC-e documents issued within São Paulo state (SP) and accessible via the state's public consultation portal. The access key must correspond to a valid, already-authorized NFC-e document. Documents that have been cancelled or are pending authorization may not return full data.
The nfce.fazenda.sp.gov.br API is a managed, monitored endpoint for www.nfce.fazenda.sp.gov.br — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when www.nfce.fazenda.sp.gov.br changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official www.nfce.fazenda.sp.gov.br API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Automate expense reporting by parsing NFC-e QR codes scanned from paper receipts into structured line items.
- Verify supplier invoices by cross-checking
cnpj,invoice_number, andtotal_spentagainst purchase orders. - Build personal finance apps that categorize grocery spending from itemized
itemsarrays. - Audit reimbursement claims by extracting
authorization_protocolandemission_datefrom employee receipts. - Aggregate retail purchase data from São Paulo consumers for market research using product
nameandunit_pricefields. - Validate fiscal compliance by confirming
authorization_protocolpresence on submitted NFC-e documents.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does nfce.fazenda.sp.gov.br offer an official developer API?+
What exactly does get_receipt return for the items on a receipt?+
items array returns one object per line item, each with name, code, quantity, unit, unit_price, and total_price. It does not aggregate by category — every distinct product line appears separately as recorded on the fiscal document.Does the API cover NFC-e receipts from states other than São Paulo?+
Does the response include tax breakdown per item or per receipt?+
What happens if the access_key corresponds to a cancelled or invalid NFC-e document?+
p parameter value from the QR code URL, including the pipe-separated suffix fields, to ensure the key is correctly formed.