-
-
Save omarkdev/d49c3bf15359f3b32664af9f06dade71 to your computer and use it in GitHub Desktop.
cpf_consulta_api_sus.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const http = require('http'); | |
const cpf = process.argv[2]; | |
const url = 'http://dabsistemas.saude.gov.br/sistemas/sadab/js/buscar_cpf_dbpessoa.json.php?cpf=' | |
const consult = `${url}${cpf}`; | |
http.get(consult, res => { | |
let body = ''; | |
res.on('data', data => body += data) | |
res.on('end', () => { | |
console.log(JSON.parse(body)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment