0.2.0 • Published 9 years ago

cep-scraper v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

CEP Scraper

A JavaScript client to scrape data from BuscaCEP.

Install

Inside your application directory:

$ npm install cep-scraper --save

Examples

Get address from postcode

Code

var CEP = require('cep-scraper');

CEP.scrape('01310-000', function(res) {
  console.log(res.data);
});

Output

{
  "data": [
    {
      "address": {
        "name": "Avenida Paulista",
        "range": [
          "start",
          "610"
        ],
        "side": "even"
      },
      "district": "Bela Vista",
      "city": "São Paulo",
      "state": "SP",
      "postcode": "01310-000",
      "client": ""
    }
  ]
}

Search using a string

Code

var CEP = require('cep-scraper');

CEP.scrape('avenida paulista 1111', function(res) {
  console.log(res.data);
});

Output

{
  "data": [
    {
      "address": {
        "name": "Avenida Paulista",
        "number": 1111
      },
      "district": "Bela Vista",
      "city": "São Paulo",
      "state": "SP",
      "postcode": "01311-920",
      "client": "Citibank S.A."
    }
  ]
}
0.2.0

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago