Giter VIP home page Giter VIP logo

Comments (5)

RobertMyles avatar RobertMyles commented on August 22, 2024 1

Ah, understood, my mistake, I was confusing it with the cidade/estado request.

from cepr.

RobertMyles avatar RobertMyles commented on August 22, 2024

Seems there is an API issue. Running the code from the site examples gives me:

GET("http://www.cepaberto.com/api/v3/address?estado=SP&cidade=Ubatuba",
  add_headers(Authorization = auth)) %>% 
  content("parsed")

Result:

named list()

This is not an R issue. Copying directly from the site:

import requests

url = "http://www.cepaberto.com/api/v3/address"
headers = {'Authorization': 'Token token=XXXXXXXXXX'}
params = {'estado': 'SP', 'cidade': 'Ubatuba'}
response = requests.get(url, headers=headers, params=params)
print(response.json())

Result:

{}

from cepr.

RobertMyles avatar RobertMyles commented on August 22, 2024

@edumucelli do we need lat & lng for estado/cidade requests, Eduardo?

GET("http://www.cepaberto.com/api/v3/nearest?cidade=Ubatuba&estado=SP", add_headers(Authorization = auth)) %>% content("parsed")
$message
[1] "Atributos \"lat\" e \"lng\" necessários"

from cepr.

edumucelli avatar edumucelli commented on August 22, 2024

nearest only takes lat and lng. The semantic behind it is that it will find the nearby CEPs from a point centered on this very coordinate formed by the lat and lng.

I could indeed make it accept a cidade and estado but I have not thought about it beforehand.

from cepr.

RobertMyles avatar RobertMyles commented on August 22, 2024

Closing, CRAN submission underway.

from cepr.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.