Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Permite consultar nombres y actividades econónicas de personas usando la web del servicio de impuestos internos de chile (SII)

License

NotificationsYou must be signed in to change notification settings

Eitol/gosii

Repository files navigation

This is a Golang library for fetching the name and commercial activities of a Chilean citizen using their RUT (Rol Único Tributario) from the Servicio de Impuestos Internos (SII) of Chile.

Installation

Use the go get command to install the library:

go get github.com/Eitol/gosii

Usage

// Print the name of a person given their RUTpackage mainimport ("fmt""github.com/Eitol/gosii""strconv")funcmain() {rutExample:="5.126.663-3"// RUT de Sebastian PiñerassiClient:=gosii.NewClient()citizen,err:=ssiClient.GetNameByRUT(rutExample)iferr!=nil {panic(err)    }fmt.Println(citizen.Name)// Output: MIGUEL JUAN SEBASTIAN PINERA ECHENIQUEfmt.Print(citizen.Activities[0])// Output: 829900// Note: "829900" is the code of "OTRAS ACTIVIDADES DE SERVICIOS DE APOYO A LAS EMPRESAS N.C.P"}

How it Works

The library works by making HTTP requests to the SII's web services and parsing the responses. The flow can be summarized in the following steps:

1- Fetch a captcha challenge from SII's service (necessary for making requests).

2- Send a POST request to SII's service with the provided RUT and the fetched captcha.

3- Parse the HTML response to extract the citizen's name and associated commercial activities.

A crucial step in this process is fetching and solving the captcha challenge.

To solve the captcha, the library decodes a base64 encoded string provided by SII's service, which includes the captcha solution.

flow

echo | openssl s_client -servername zeus.sii.cl -connect zeus.sii.cl:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > zeus_sii.pem

Note

The Software is provided for academic purposes only. Commercial use is not permitted.

About

Permite consultar nombres y actividades econónicas de personas usando la web del servicio de impuestos internos de chile (SII)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp