My city zip code, where can I find open, updated and reliable source?

Asked

Viewed 10,435 times

40

The Postal Address Code, CEP (or ZIP code) the addresses of a city guarantee greater reliability to address data and to geolocation resolution by address... Remembering that address is not only useful for sending letters by mail, it is an essential complement to the registration of a natural person (location even if approximate to where you live) or legal (company headquarters address), present in databases of Crms, Erps, etc. and standards such as vCard, Schema, and hundreds of others.

The question is "Where is the data of my city?", and may have a specific answer for each country of the Portuguese language, as well as, eventually, for each city (!), because cities have a certain autonomy on the subject. As I took the city of Campinas as an example, it is suggested that we restrict discussions to Campinas.

In the case of Brazil, the data are neither under the responsibility of IBGE nor under the responsibility of the City Hall, although the city is responsible for the "baptism laws" of each street name of the city (street example of Campinas).


NOTES

  • The Geonames has committed to building an outline of this database, but does not resolve.

  • The Openstreetmap seems to have a part of the data (!). In fact, the ideal for the CEP is to have it spatialized (given a geographical coordinate of the city, return the CEP of the coordinate).

  • The National Address Directory (DNE) is the database maintained by the Brazilian Postal and Telegraph Company (ECT), better known as "Post Office" in Brazil, to validate postal addresses and determine Zip Codes. She can’t be on a base supported by CKAN or any other initiative of Dados Aberto.

  • 2

    I think that this question has already concluded that there is no alternative and so it may be a duplicate: http://answall.com/q/400/101

  • @bigown, Yes, very similar, but I consider the approach here different: it is strictly about open data, or initiatives for the legal capture of these data... Finally, a "workaround" more solid.

  • 8

    I understood that, is that there is concluded that does not exist.

  • The question is about searching addresses from Zip Codes, vice versa or, by geo-location, all this? - I know of a free direct integration to the post office base that allows to locate address by zip code, I can post, if that is the focus.

  • @Gêbender Check first if you don’t already have it on another question about Ceps.

  • Valeu @utluiz, really already has an answer with a very similar script, is a Rawler from the post office mobile site. I have been using for a long time (a few years) and attending well, virtually no falls or any problems of the kind. But, there is always the risk of the post office closing the door, putting captcha, etc. Whoever wants the code, contact.

  • The postmon doesn’t have what you need?

  • You can try using a Crawler and make your own database.

  • What I find most reliable nowadays is Google Maps. I use the Googlemaps API to search by zip code and the result is quite satisfactory. The only problem with the Google Maps API is that it has a usage limit every 24 hours for each IP, I think 100,000 requests. But if your site isn’t too big, the Maps API can handle it. Abs

  • A variation of the question, but more specific about maps and on CEP5 (no CEP8) was posted in http://answall.com/q/73640/4186

  • viacep.com.br/Ws/76821348/json/

Show 6 more comments

9 answers

17

Unfortunately, all available information points to the answer that there is no ZIP database that is open, up-to-date and reliable.

According to the Wikipedia the Post Office created and maintains the CEP base, that is, it belongs to the company, it is not a public information by default.

Updated and reliable base

As it can be consulted by anyone on the Post Office website, the official electronic base and its updates can be purchased as a product called DNE. The description of the site says:

It is the official and exclusive base of the Post Office, so the information is reliable and updated.

The cost initial (in 04/2015) will R $ 1.100,00 to R $ 2.100,00, off renewals to receive quarterly registration updates.

According to the product details, the database is made available in two formats:

  1. Text file (.txt)
  2. Microsoft Access database (.mdb)

Other services

Other companies may purchase the ZIP Code database and provide services for consultation, whether paid or free. However, they are directly dependent on postal updates. See this article, for example.

Particularly, I find it difficult to find an updated free base, because the owner would have to bear the costs of the product and the updates of the Post Office and still maintain a high availability Web Service.

Open bases

Some websites and even blogs provide databases for download. However, these databases cannot be considered reliable or up-to-date, as there is no guarantee that the data is actually correct and that the base updates represent the latest postal updates.

I am not aware of the legal implications, but I believe that some of these solutions are illegal, if they are only providing the database sold by the post office in another format.

Completion

There are now reliable and updated but paid ZIP sources (Post Office) and open sources but untrusted and perhaps not updated (other websites).

For companies, for example those working with virtual stores, investing in the Post Office base would be the best way out.

For personal projects, using a less reliable basis would be quite acceptable, especially if there is possibility of manual updating when necessary.

  • 2

    "that is, it belongs to the company" - It is worth noting that who created was a federal municipality, then federal public entity, and not a private company. And the base was open to the public, its closure was another absurd maneuver that only happens in places like Brazil.

  • @Bacco Yes, but whether it’s a public or a private company, it makes no difference. Sometimes we have the notion that because a company is public then all its information should be open, services and products should be free, etc., but in reality it is nothing like that.

  • 2

    Not all of them, but in the public interest, for sure. This "semi-privatization" of the Post Office was another of the political problems of our country, with interests in my view, doubtful.

  • @Bacco Yes, some by measure of law, when the citizen has the "right" to such and such service, then the Government subsidizes, paying for it in some way, as is the case of the SUS, for example.

  • 2

    You can’t compare the two. The SUS needs volumes of money to exist, such database already exists by the nature of the (public) service provided by the Post Office, there is no cost to justify what is charged by the database. And all the maintenance of the entity is already done by charging the services and means you mentioned. I’m not going to dwell on the question of the scope of the answer, but I think it’s important for people to realize that it’s not that simple.

  • 2

    @Bacco You are right, it is not the same thing. However, it does not change the fact that this value integrates the profit of the company. If the information were made available for free, either the net profit would decrease or the Post Office would increase the price of another service. I think in the end our mistake is to think that public companies like the Post Office do not aim at profit like any other company.

  • Dear @Bacco and Utluiz, I have added an "answer" so that we can discuss what may be the key point of the question.

  • Good @utluiz approach, and that’s right, today we don’t have much beyond what you mentioned, or it’s around here, or it’s around here.

  • 1

    @Fernando, note item 3.1 of the "legal alternatives"...

  • @utluiz, by the rules you get the reward, deserved (!): if you think not, I click here, let me know. By my discretion had no answer: no one showed "where can find open source, updated and reliable"... what was to be expected (but I do not want to look like intentional prank)... Maybe I’ll mark in the future as "accepted" my statement of "Legal alternatives", for being an "algorithm for the answer" :-)

  • I found a complete database with the Ceps do Brasil that can be accessed free of charge through this link: https://www.back4app.com/database/back4app/api-cep-correios

Show 6 more comments

13

(is not answer but VOTE negative or positive to express your opinion!)
(is a WIKI: edit the will to better indicate the position)


Possible legal alternatives

What is being said, and perhaps the time is right to test with greater commitment on the part of organised society, is that the EPC is a public good, a open dice, not appropriated by a company... Enumerating to be able to cite the arguments in the comments and discussions:

  1. The names of the public things of a city (public place, events, etc.) are equally public. Who has the power to name the streets of cities in Brazil, is the municipal government, traditionally the City Councils. Example. Public numeric identifiers are conceptually "names"...
    For legal purposes, the CEP is a public name of the municipality.
    TECHNICAL NOTE: names can have ID function, and Ids can have name function, the concept that unites the two things is the uniform name, URN. The EPC is also, for all intents and purposes, a type of URN.

  2. If a Law establishes rules to be followed by businesses and citizens, this Law cannot be paid...
    (to Constituting requires the publication of the text of any law, art. 37, and guarantees free access to the same text, art. 216, § 2º)

    2.1. There are laws that require us to fill out forms with address and zip code, therefore, as a logical consequence of the "obligation by law to complete the CEP", there can be no collection of the "CEP database".

    2.2. Imagine the text of a "CEP Law": a listing of each street section of the city being baptized by a ID, said ZIP CODE.
    The "CEP Law" is today a paid and private text... However, according to the Brazilian Constitution (articles listed above), a text of Law, including parts such as tables and lists, must be a open dice.
    PS: an alderman or even a grassroots initiative can create the "CEP Law" of your municipality, explaining the CEP lists in official text, as is done with street names.

  3. The supposed "right to monopoly" by the rendering of the "baptism service", possibly granted in the past (there was no public consultation or confirmation of constitutionality), to the "baptizing company of Ceps", can’t be eternal, must close after the period of operation of the return on investment...

    3.1. For practical and ethical purposes, this date has already expired, the service has "been paid for".

    3.2. Today (2015) it is no longer justified to charge for such a service, the Openstreetmap, Geonames and free tools such as Postgis, demonstrate how much the "spatially consistent baptism algorithms" are simple: it is up to the technical community (we here!) to demonstrate that this algorithm is free and the government can use without having to pay for a private company to "develop".

  4. The CEP can be characterized as public utility, and the municipality can formally express the "declaration of public utility in its domains" (see item 1).


... More legal arguments? Edit, here is a WIKI! ...

  • 2

    2.1 is a good point. I will not go into the legal merit (despite my background), because for me the problem is first of all of moral order and typical of a country that is not serious. This type of collection completely ignores the public interest, and privileges large companies.

  • Further consolidated arguments: http://codigourbano.org/por-que-o-cep-deve-ser-tratado-informacao-publica/

9


Summary of the e-SIC request:

Having knowledge about the law of access to information, through the e-SIC, I sent a request to CORREIOS of this base by the higher agency ECT - Empresa Brasileira de Correios e Telégrafos.

In response, they sent me the link http://www.shopping.correios.com.br/ so that I could acquire the basis, strengthening that the post office is governed by laws that guide its activities. I sent as a first instance resource reinforcing the request and once again sent me the link to the post office mall. Still insisting, I sent as a second instance appeal directly to the president of CORREIOS Wagner Pinheiro, stating that the Law 6.538/78 that allows the company to market its database (mentioned by them) is older than the Law of Access to information, which takes precedence over the law of the postal service. I got the answer "The ZIP Code database, the object of your request is a product marketed by the Post Office." and sent me the link of the post office for free consultations (but what I want is the complete basis) and so once again sent me the link of the post office mall.

At the end of the response of the appeal of the second instance: "Any resources should be directed to the Comptroller General of the Union, according to Art. 23 of Decreto 7.724/2012 regulating the Law on Access to Information - Law 12,527/2011, within 10 days from receipt of this reply."

As two days have passed, I now have 8 days to solve this problem and I would like to know how to proceed.


Down with thread complete:

First request

Hello, I would like a base with all the Zip Codes of Brazil. Finally, with all the information of locality corresponding to the Zip Codes. Thanks.

Answer:

ECT, through the ZIP Search, makes available on the site http://www.buscacep.correios.com.br/ , to every citizen, the free consultation of the Postal Address Code - CEP in an individualized way.

As a public company, the Post Office is governed by laws that guide its activities. In accordance with the Law 6.538/78 governing the rights and obligations pertaining to the Postal Service, notably by by virtue of Article 8, inc. II, ECT may market its EPC database, as transcribed below: "8th Are activities related to the postal service: ll-Sale of publications disclosing regulations, standards, tariffs, mailing lists and other matters related to the postal service".

The CEP database is provided through the e-DNE product in the Basic and Master modalities, and can be purchased in the virtual store http://www.shopping.correios.com.br/.

The Post Office thanks you for your understanding.

ANTONIO DE PAULA BRAQUEHAIS
DEPRO
DEPARTMENT OF COMMUNICATION-DEPRO PRODUCTS

Any resources should be directed to the Vice President of Business, according to Art. 21 of Decreto 7.724/2012 governing the Access to Information Act - Law 12.527/2011, within 10 days of receipt of this reply.

Citizen Information Service Brazilian Post and Telegraph Company

Appeal at first instance

I would like a base where I would find the state code, the state, the city code, the city, the neighborhood code, the neighborhood, the street and its zip code. Anyway, all about location based on the patios. Hugs!

Answer:

Dear Mr Judson,,

The CEP database is provided through the DNE product in the Basic and Master modalities, and can be purchased in the virtual store http://www.shopping.correios.com.br/.

ECT through the ZIP Search, available on the site http://www.buscacep.correios.com.br/, to every citizen, the free consultation of the Postal Address Code - CEP in an individualized way . The Post Office appreciate your understanding.

Morgana Cristina Santos Vice President of Business

Any appeals should be addressed to the President of the Post Office, according to Art. 21 of Decree 7.724/2012 that regulates the Access to Information Act - Law 12.527/2011, within 10 days, from receipt of this reply.

Citizen Information Service
Brazilian Post and Telegraph Company

Appeal:

To Mr Wagner Pinheiro

President of S/A POST

I come through this, impelling administrative appeal in second instance, regarding the request for information XXX regarding the request for digital copy of the ZIP Code Database - Modality Master.

In response in previous instances, CORREIOS informed us that the Law 6.538/78 allows the company to market its database, with fulcrum in the content of article 8 of this law:

"8th Are activities related to the postal service: ll-Sale of publications disclosing regulations, standards, tariffs, mailing lists and other matters related to the postal service".

However, we understand that the Law on Access to Information, (12.527/2011), because it is a law more recent than the law that regulates the postal service (6538/78), takes precedence over it. It should be noted that public companies, such as CORREIOS, are also subject to the Information Access Law, according to its Art 1º, Item II

Art. 1º This Law provides on the procedures to be observed by the Union, States, Federal District and Municipalities, in order to ensure access to information provided in item XXXIII of art. 5o, in section II of § 3º of art. 37 and in § 2º of art. 216 of Federal Constitution.

Sole paragraph. They are subject to the rules of this Law:

I - the public bodies that are members of the direct administration of the Executive, Legislative, including the Courts of Auditors, and the Judiciary and the Public Prosecutor’s Office;

II - the municipalities, the public foundations, the public companies, the mixed economy companies and other entities controlled directly or indirectly by the Union, States, Federal District and Municipalities It should be noted that the Access to Information Act, in particular its Article 10, does not contain any provision restricting the provision of commercially available information. We also understand that when requesting a digital copy of the CEP database, we are not infringing the content of Law 6.538/78, because there is no intention to prevent the commercialization of the CEP base for those who want to buy it. We are only requesting a free copy based on the legal provision of the Information Access Act. Therefore, I ask your attention to the administrative appeal in question, seeking to achieve the objective of obtaining a digital copy of the CEP database, as explained above.

Answer:

Dear Lord, dear Lord, "The CEP database, the object of your request, is a product marketed by the Post Office. The information in an individualized way is available, through the CEP Search, on the site WWW.correios.com.br, which enables any citizen to consult for free the Postal Address Code - CEP, in the following forms:

  1. ZIP CODE or Address;
  2. Zip code by locality/Street;
  3. Address by zip code;
  4. ZIP Code by Neighborhood;
  5. Zip stripes;
  6. Zip codes of operational units;
  7. Special zip code;
  8. Community post office box;
  9. ZIP Code by PO Box;
  10. ZIP CODE.

The compiled information is provided through the e-DNE product in the Basic and Master modalities, which is purchased in the virtual store http://www.shopping.correios.com.br/. The National Directory of Addresses - DNE is considered new and original intellectual work, pursuant to Law Nº 9.610/1998 - Copyright Law. The said invention is constituted in database, whose property rights of author are under the exclusive ownership of the Empresa Brasileira de Correios e Telégrafos - ECT, including by virtue of articles 2,§1º,"b"; 8º, inc. II and 15º, §1º da Law 6.538/78, may be licensed through direct contracting, backed by the cover of art. 25 of Law 8.666/93. On 10/04/2002, the ECT filed and is the rightful proprietor before the National Institute of Industrial Property (INPI) of the Invention Patent application, under the number PI 0.204.305-0, entitled "DIRECTORIO NACIONAL DE ENDEREÇOS (DNE)". On 10/07/2003, ECT filed and is the rightful holder of the extension of the invention patent, indicated in 1.1.3, before the German Patent Applicatations, under number 10.346.551.0.

In view of the above, I decide by the knowledge of the present appeal, to, on the merits, deny plea, with fulcrum in art. 13, III of Decree 7.724/2012.

The Post Office appreciate your understanding.

Wagner Pinheiro de Oliveira
CHAIRMAN
Brazilian Post and Telegraph Company

Any resources should be directed to the Comptroller General of the Union, according to Art. 23 of Decree 7.724/2012 that regulates the Access to Information Act - Law 12.527/2011, within 10 days, from receipt of this reply.

Citizen Information Service
Brazilian Post and Telegraph Company

  • Thanks for sharing! We have little time... Who is expert in legal writing or willing to assist Judson in responding, you can contact us here or in the list Okbr

  • I will create another "false answer" to this question to house in the form of Wiki the collaborative text of CGU resource... What do you think?

  • Yes, it may be..

  • The deadline is tomorrow or Monday?

  • What was the outcome of the petition?

7

So far, the most complete I found was in a forum where the user posted that searched through the post office (did not say how) and got an updated until Feb. 2015, if I’m not mistaken.

I made available to those who want to download here.

An alternative would be to request also by e-SIC.

5

I have already lost some nights in the dark trying to find an alternative that would give me reliability on the base of the CEP, without being able to pay for the post office. What I found was the use of the Apis mentioned above, but they do not guarantee reliability. I ended up taking priority over this. And now I need it again.

The Access to Information Act "regulates the constitutional right of access to public information" [1]

According to the post office website itself, public information is available on it and is of collective interest. [2]

Therefore, despite not having legal training, I believe that through LAI the CEP base should be made available in full, since it is information of collective interest, including can be consulted on the website manually, then it will not generate any cost to the couriers if it makes available as an open data.

I will make a request through SIC, release here when I receive a reply.

[1] http://www.acessoainformacao.gov.br/assuntos/conheca-seu-direito/a-lei-de-acesso-a-informacao

[2] http://www.correios.com.br/sobre-correios/acesso-a-informacao

4

The charge at this price is abusive, absurd.

In a post blog post there was already a discussion, and there was even a guy saying he would look for political representatives "so that they explain how a public body can charge for full access to public data".

The standard Post Office response (very annoying) is as follows:

As mentioned in the post, the consultation of the ZIP Code of all Brazil for the posting of correspondence continues to be offered free of charge by the Post Office, through guides in the agencies or by the ZIP Search, on the Post Office website (www.correios.com.br).

In the same post some sources have been cited, which are not official, and this (that is paid, but at a reasonable price) seemed to me the most reliable.

During my research I found this post (2012! ) on the subject, in a google group, where a guy made a complaint on the site Access to Information. See what he says:

I put it there on the http://www.acessoainformacao.gov.br/ my request in these terms:

Many systems require access to the CEP database, but ECT puts technical and financial barriers to access to this data. The lack of free access to this database causes the dissemination of outdated copies, which harms not only users but the ECT itself, since she is required to deliver mail even with the ZIP code incorrectly informed. Therefore it is in the interest of the public and the ECT itself that these data are offered in a way free through an open and easy API (programming interface) utilizing. """

What happens, once an ECT systems analyst told me, is that there is a "business unit" in the ECT which is in charge of market the EPC base. Indeed, according to him, this marketing pays the wages of some managers and sellers, but causes damage to ECT because it loses more money on treatment missing or incorrect ZIP Code correspondence "selling" the CEP base. Ironically, the biggest users of this base, such as Teles, banks etc. in reality don’t pay for it because the license cost of the CEP base ends up being just one item insignificant in the overall negotiation of contracts with these large customers!

Finally, in addition to the excellent post on this legal issue (above) I consider appropriate a warrant for security (if they were private information would be a habeas data) in the Federal Court, based on the arguments cited by the colleague, but mainly in view of the very high amount charged (in the US tbm is charged, but thing from $ 39 to 249$).

It would even make sense to charge for a product with many advantages (different from CBO for example, which comes in pdf and makes life difficult, as I said in this question), but this price is ridiculous, impractical. Moreover, they could make the database available in a file. txt for example, without the software developed, for those who wanted to use the base for free.

I believe that there is no other type of product (information) provided by any other government agency with such an absurd price.

Well, I hope I haven’t talked too much and collaborated on the topic (despite the high opinion of the answer). :-)

  • 1

    I see in the future this data being accessed by an API for free, what is missing is someone smart on the inside to resolve this issue. It is impossible for Brazil to go forward with these obstacles that harm small businesses, this is typical of backward people who are in power in these sectors and should have already been migrated to areas that do not need to use the brain.

3

I don’t know how often this base is updated, but this service has been on the air for several years and has never fallen.

They also provide the base for download.

http://republicavirtual.com.br/cep

  • 2

    Good tip (!)... But duplicated, see previous discussion. What was concluded there was that the Republicavirtual and many others, offer a very outdated base, and without a maintainer community, as the Openstreetmap, Geonames, etc... Even without maps, there are methodologies of collaboration and updating as this example from Openknowledge. As there are doubts/legal, no such entity assumes a serious and updated ZIP Code repository.

  • 1

    Fact. Unfortunately we cannot consult our own official Post Office base. An absurdity in my opinion, because this should be the right of anyone.

2

(This is not an answer, it’s a Wiki p. then join back on judson’s answer)

PAD closed or the mailing list we’re checking. DRAFT v0.6 of 2015-05-21, closed review.

Collaborative text for use by CGU

To the Union Comptroller General,

The non-disclosure of Ceps is unconstitutional, because the Constitution (art. 37) requires the advertising of the complete CEP List in digital format open and accessible to the citizen. Does not require the free distribution of a "product" (the DNE, which can be understood as a "packaging" of the CEP List).

  1. Auxiliary interpretations:

    1.1. List of Ceps of the municipality. It is a complete list, of all CEP codes with incidence on the municipality, and to each CEP the detailed indication of the streets (and their respective neighborhoods, subdistricts and districts) or stretches of street (quadra faces) that compose each CEP. That list (also called "compiled information") shall be offered in digital format (e.g. CSV files), as set out in http://dados.gov.br/dados-abertos/

    1.2. The CEP is a public good, its "owner" is the municipality. The names of the public things of a city (public place, events, etc.) are equally public. Who has the power to name the streets of cities in Brazil, is the municipal government, traditionally the City Councils. The zip code is an "official name", an aggregator of names of streets of the municipality; by extension, the "owner" of the zip code is the municipal government.

    1.3. The List of Zip Codes is a public utility, which is part of the city’s informational infrastructure. Its "public utility" character is recognised and indisputable, so that, as a land or social equipment, the claim of private property can be challenged legitimately and in favor of the rights and will of the citizens. According to Artsº 3, Inciso II, 5º and 6º, Inciso I of Federal Law 12.527/2011, public companies such as Empresa Brasileira de Correios e Telégrafos (ECT) need to disclose information of public interest, guaranteeing the right of access to information in a transparent and clear, providing ample access to them. It should also be noted that Art. 8th of the Law on Access to Information provides objectively on the duties of public bodies and entities when the provision of information of collective or general interest produced or safeguarded by them, which is the case of the List of Zip Codes.

    1.4. Considering the Art. 4º of the Federal Decree 7.724/2013, which regulates the Access to Information Law, the search and the provision of information are free, except for the collection of the value related to the cost of services. In the interim, it can be demonstrated that there is no justifiable cost in this type of transaction, which has not been extensively compensated for the years of commercial exploitation of the "packaging" of the CEP List that have already been granted to the company. In addition, the supposed technology to add new Ceps to the Ceps of the municipality, is simple and wide public domain nowadays, making obsolete any justifications around its maintenance cost. If the CGU requests we can offer a broad demonstrative study, including the ineffectiveness of the current operator and authority of the CEP attribution system.

    1.4.1. It can be shown that there is no justifiable cost in such an operation, which has not been extensively compensated for the years of commercial exploitation that have already been granted to the company. The diffuse interest today is organized and produces sophisticated technologies such as www.geonames.org or www.openstreetmap.org, having also support from municipalities, sanitation and energy companies, still hampered by the delay in the allocation of the CEP (causing losses in property tax bills, water and electricity).

    1.5. The Laws of Brazil are a public good, open and accessible, and all content cited by a Law should be equally open and accessible. This is what is commonly called "contamination of access to the Law": figures, maps, tables, lists, any object cited by the text of a Law must be equally accessible. Technical standards which directly (by citation) or indirectly regulate the requirements of the Law, are also understood as "objects cited".

    1.5.1. A typical example of a solution for this passage is the conduct adjustment term of ABNT http://www.pessoacomdeficiencia.gov.br/app/normas-da-abnt/termo-de-ajustamento-de-conduta

    1.6. The alleged "individualized information", i.e., networked computer programs that perform the so-called "resolution of an individual CEP":

    1.6.1. is not characterized as Open dice. It is a reading of the data made by third parties, and with a universe of very restricted use. A public utility assumes that the list of ceps can be used by the most varied systems, from maps to logistic systems, public and private, including government applications such as SUS - see standard Datasus and system in offline use, as well as damages already caused to public funds and health by its not filling in forms.

    1.6.2. is not available at more than one address, and the single address offers no guarantee of persistence or reliability. It is known that technically the only way to give this guarantee is by replicating the software at other addresses (other servers) and other networks (open and closed).

    1.6.3. as an example, Brazil and Brazilians invest, directly and indirectly, millions of reais every year in the so-called CRM (Customer Relationship Management) and ERP (Enterprise Resource Planning) systems): all have modules that require high-performance access and reliability, including offiline (off the Internet), to Ceps.

  2. The CEP is required by the government in our day-to-day, and a requirement set in Laws and technical standards (which regulate Laws): there are ample and indisputable examples of cases where the EPC is required, from simple forms (annexes to standards), to contracts where there is a requirement to fill in the EPC. This characterizes the "contamination" expressed in item 1.5 above.

  3. Unconstitutionality. THE CONSTITUTION OF THE FEDERATIVE REPUBLIC OF BRAZIL OF 1988 (CF) in its article 37 expresses the mandatory publication; in Article 5, point XIV, the right of access; in its Article 216, § 2, to Duty of admission to duty. Therefore, for item 2 above, and for the FC, the Ciadão should not pay for the Ceps (defined in item 1).


  1. The following are resubmitted unanswered arguments, and added brief responses to the company’s alleged defense arguments.

    4.1. Public goods and public information are not subject to exclusion by copyright or patent, should either annul the patent or understand that the value of the product is in the very particular and specific form as the Ceps was "packed".

    4.1.1. It can be demonstrated "by absurdity" (reductio ad absurdum) that, if other companies registered right on other "forms of packaging the List of Zip Codes", they would be performing an unconstitutional practice for trying to curtail the right of access to information. We can list at least 5 companies "competitors of ECT" that are already seeking their niche market due to the legal inconsistencies of the "right to the ZIP code"".

    4.1.2. It seems clear to us that the contents of the database are not patentable and, if this happens, may be declared null by virtue of art. 46 of Law 9.279/1996.

    4.2. As already mentioned in item 1.6.3, many systems require access to the EPC database, but today the company (ECT) imposes technical and financial barriers to access to these data. The lack of free access to Ceps causes the dissemination of outdated copies, which harms not only users but the ECT itself, since it is required to deliver correspondence even with the ZIP code incorrectly informed. Therefore it is in the interest of the public and the ECT itself that the Ceps is fully accessible.

    4.3. Law nº 6.538 of 1978, from which the sustainability of the monopoly of the ECT is claimed, is prior to the 1988 Constitution, and has not been corrected.

    4.3.1. At the same time, in compliance with the provisions of the caput of art. 15 of the Postal Law, the list with the aggregated registration of the Postal Address Codes was made available throughout the ECT agency, and therefore the access to the compiled information (complete list) is within the reach of the citizen. The purchase of the list was provided in the same place, and did not pay for patents or copyrights, only for the cost of printing and distribution.

    4.3.2. The Law does not prohibit the free distribution of the list, according to art §3º. 15, and that the search and seizure to which mention the 2nd is directly related to any revenue from advertising inserted in such lists. Of course, the exploitation income of the List does not come from the information contained in it, but from its use for sale of aggregated products or services. There is, therefore, no legal provision that gives the CEP, individually considered or aggregated in list, intrinsic character of strategic information.

    4.3.3. Let us remember that it is the Union’s responsibility to maintain the postal service, not necessarily the monopoly exploitation of it. In other words, it is situated the development and attribution of indexation to real public service premises uti Universi, that, despite serving the good performance of economic activity, does not mix with it. If, therefore, the individualized information cannot be considered confidential or private, neither can the aggregated information in a Ceps complete, or in a database prepared as a product.


More complete characterization of the "List of Zip Codes" (then we can add UML data model) in case they doubt its meaning:

  • List of patios of the municipality: to each item on the list its identifier and full (unambiguous) name of the street. Every "access route" to a address is a backyard.
  • List of names of neighborhoods municipality: to each item on the list its identifier and full name (unambiguous) of the district (name adopted to refer to the district or subdivision).
  • List of Common zip codes: to each item of the list the smallest reference entity (region, street, stretch of street or stretch and parity of street) associated to the respective CEP code and respective street identifier.
  • List of Special zip code: ...
  • Hello, folks Thank you very much! I look forward to everyone’s contribution until tomorrow

  • Hello, everyone. The resource has been sent. Now just wait!

-1

Following the suggestion of colleague Jackson Emmerich, one idea is to use the API of the viacep.com.br.

Their API can be used in these two ways, depending on the format desired for the output:

http://viacep.com.br/ws/[cep-a-pesquisar]/[formato]
http://viacep.com.br/ws/[estado]/[cidade]/[string-de-busca]

The accepted formats are the json, xml, jsonp, querty and piped.

Search for ZIP code

Here is an example for JSON 76.821-348:

http://viacep.com.br/ws/76821348/json
{
  "cep": "76821-348",
  "logradouro": "Rua Thales Benevides",
  "complemento": "",
  "bairro": "Rio Madeira",
  "localidade": "Porto Velho",
  "uf": "RO",
  "unidade": "",
  "ibge": "1100205",
  "gia": ""
}

Same example for XML:

http://viacep.com.br/ws/76821348/xml
<?xml version="1.0" encoding="UTF-8"?>
<xmlcep>
    <cep>76821-348</cep>
    <logradouro>Rua Thales Benevides</logradouro>
    <complemento/>
    <bairro>Rio Madeira</bairro>
    <localidade>Porto Velho</localidade>
    <uf>RO</uf>
    <unidade/>
    <ibge>1100205</ibge>
    <gia/>
</xmlcep>

Another example, for CEP 01.001-000:

http://viacep.com.br/ws/01001000/json
http://viacep.com.br/ws/01001000/xml
{
  "cep": "01001-000",
  "logradouro": "Praça da Sé",
  "complemento": "lado ímpar",
  "bairro": "Sé",
  "localidade": "São Paulo",
  "uf": "SP",
  "unidade": "",
  "ibge": "3550308",
  "gia": "1004"
}
<?xml version="1.0" encoding="UTF-8"?>
<xmlcep>
    <cep>01001-000</cep>
    <logradouro>Praça da Sé</logradouro>
    <complemento>lado ímpar</complemento>
    <bairro>Sé</bairro>
    <localidade>São Paulo</localidade>
    <uf>SP</uf>
    <unidade></unidade>
    <ibge>3550308</ibge>
    <gia>1004</gia>
</xmlcep>

For JSONP format, just add ?callback=nome_da_funcao in JSON-terminated URL. For example:

http://viacep.com.br/ws/01001000/json?callback=foo

Gives as exit:

foo({
  "cep": "01001-000",
  "logradouro": "Praça da Sé",
  "complemento": "lado ímpar",
  "bairro": "Sé",
  "localidade": "São Paulo",
  "uf": "SP",
  "unidade": "",
  "ibge": "3550308",
  "gia": "1004"
});

The Piped format (fields separated by | and separate value key by :), that’s how it is:

http://viacep.com.br/ws/01001000/piped
cep:01001-000|logradouro:Praça da Sé|complemento:lado ímpar|bairro:Sé|localidade:São Paulo|uf:SP|unidade:|ibge:3550308|gia:1004

The querty format is the format used in query-strings GET type or as a POST form request body. Here’s an example:

http://viacep.com.br/ws/01001000/querty

cep=01001-000&street=Pra%C3%A7a+da+S%C3%A9&complement=lado+%C3%Admpar&bairro=S%C3%A9&locality=S%C3%A3o+Paulo&uf=Sp&unit=&ibge=3550308&Gia=1004

Search by address

For the search for addresses, the format is almost the same as the search for Ceps (the difference is that a list of places is brought instead of a single street).

Here is an example:

http://viacep.com.br/ws/SP/S%C3%A3o%20Paulo/Vila%20Mariana/json

Here’s the way out:

[
  {
    "cep": "04114-050",
    "logradouro": "Praça Lions Clube-Vila Mariana",
    "complemento": "",
    "bairro": "Jardim da Glória",
    "localidade": "São Paulo",
    "uf": "SP",
    "unidade": "",
    "ibge": "3550308",
    "gia": "1004"
  },
  {
    "cep": "04112-015",
    "logradouro": "Praça Comunitária da Vila Mariana",
    "complemento": "",
    "bairro": "Vila Mariana",
    "localidade": "São Paulo",
    "uf": "SP",
    "unidade": "",
    "ibge": "3550308",
    "gia": "1004"
  }
]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.