This solution allows you to query the Download CAF files from Chile's Servicio de Impuestos Internos (SII) using scraping. Download XML file using authenticated HTTPS requests with a valid digital certificate.
⚠️ This project is not affiliated with the official SII. It is intended for private automation and educational use.
Package Reference | Version |
---|---|
Azure.Storage.Blobs | 12.25.0 |
Microsoft.Extensions.Azure | 1.7.6 |
AngleSharp.XPath | 2.0.5 |
curl -X GET "https://localhost:7212/api/DescargaFolio/caf?rut=88777555-9&tipoDoc=33&folioInicio=2294&folioFin=2415&fecha=30-12-2024" \
-H "Accept: application/xml"
Return XML from controller:
Use appsettings.json
or environment variables to configure the certificate source:
{
"StorageConnection": "UseDevelopmentStorage=true",
"StorageConnection:ContainerName": "certificados",
"StorageConnection:BlobName": "certificado1.pfx",
"StorageConnection:CertPassword": "<your-cert-password>"
}
You may also define these as Azure App Settings if you're deploying the API to the cloud.
Feel free to file a new issue with a respective title and description on the Sii.DescargaFolio/issues repository.
If this tool was useful, consider contributing with ideas or improving it further.
This repository is released under the GNU General Public License v3.0.