{"id":18784153,"url":"https://github.com/kdevelopement/phpviacep","last_synced_at":"2025-12-20T23:30:22.004Z","repository":{"id":65696699,"uuid":"597587438","full_name":"KDevelopement/PHPViaCEP","owner":"KDevelopement","description":"Search for Brazilian addresses by zip code using the ViaCEP REST API.","archived":false,"fork":false,"pushed_at":"2023-04-04T16:40:56.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T11:51:43.188Z","etag":null,"topics":["php","viacep-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KDevelopement.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-05T01:36:16.000Z","updated_at":"2023-12-10T22:37:49.000Z","dependencies_parsed_at":"2023-12-09T10:45:10.981Z","dependency_job_id":null,"html_url":"https://github.com/KDevelopement/PHPViaCEP","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"4eb9b44f47a2b0b39bd92a68d3ded8803160f3de"},"previous_names":["klicense/phpviacep","ks7ven/phpviacep","kdevelopement/phpviacep"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDevelopement%2FPHPViaCEP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDevelopement%2FPHPViaCEP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDevelopement%2FPHPViaCEP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDevelopement%2FPHPViaCEP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KDevelopement","download_url":"https://codeload.github.com/KDevelopement/PHPViaCEP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699583,"owners_count":19682575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","viacep-api"],"created_at":"2024-11-07T20:42:08.908Z","updated_at":"2025-12-20T23:30:16.676Z","avatar_url":"https://github.com/KDevelopement.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ViaCEP PHP SDK\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Coverage Status](https://coveralls.io/repos/github/KS7ven/PHPViaCEP/badge.svg?branch=master)](https://coveralls.io/github/KS7ven/PHPViaCEP?branch=master)\n[![](https://github.com/KS7ven/PHPViaCEP/workflows/PHPUnit/badge.svg)](https://github.com/KS7ven/PHPViaCEP/actions/workflows/phpunit.yml)\n[![](https://github.com/KS7ven/PHPViaCEP/workflows/PHPStan/badge.svg)](https://github.com/KS7ven/PHPViaCEP/actions/workflows/phpstan.yml)\n[![](https://github.com/KS7ven/PHPViaCEP/workflows/Deptrac/badge.svg)](https://github.com/KS7ven/PHPViaCEP/actions/workflows/deptrac.yml)\n\nPesquise endereços por CEP usando a API REST [ViaCEP](https://viacep.com.br).\n\n## Instalar\n\nVia Composer\n\n``` bash\n$ composer require kseven/phpviacep\n```\n\n## Uso\n\n### findByZipCode (Sem retorno de chamada)\n\nEncontre o endereço pelo código postal.\n\n```php\nuse KSeven\\ViaCEP\\VCRun AS ViaCEP;\n\n$ViaCEP = new ViaCEP;\n\n$Address = $ViaCEP-\u003efindByZipCode('01001-000')-\u003etoArray();\n\n/*\nDeve retornar algo assim:\n\n[\n    'zipCode' =\u003e '01001-000',\n    'street' =\u003e 'Praça da Sé',\n    'complement' =\u003e 'lado ímpar',\n    'neighborhood' =\u003e 'Sé',\n    'city' =\u003e 'São Paulo',\n    'state' =\u003e 'SP',\n    'ibge' =\u003e '3550308',\n]\n*/\n\n$Address = $ViaCEP-\u003efindByZipCode('01001-000')-\u003etoJson();\n\n/*\nDeve retornar algo assim:\n\n{\n    \"zipCode\": \"01001-000\",\n    \"street\": \"Praça da Sé\",\n    \"complement\": \"lado ímpar\",\n    \"neighborhood\": \"Sé\",\n    \"city\": \"São Paulo\",\n    \"state\": \"SP\",\n    \"ibge\": \"3550308\"\n}\n*/\n```\n\n### findByZipCode (Com retorno de chamada)\n\nEncontre o endereço por código postal, com retorno de chamada.\n\n```php\nuse KSeven\\ViaCEP\\VCRun AS ViaCEP;\n\n$ViaCEP = new ViaCEP;\n\n$Address = $ViaCEP-\u003efindByZipCode('01001-000', 'callback_name')-\u003ewithCallback();\n\n/*\nDeve retornar algo assim:\n\ncallback_name({\n    \"cep\": \"01001-000\",\n    \"logradouro\": \"Praça da Sé\",\n    \"complemento\": \"lado ímpar\",\n    \"bairro\": \"Sé\",\n    \"localidade\": \"São Paulo\",\n    \"uf\": \"SP\",\n    \"ibge\": \"3550308\",\n    \"gia\": \"1004\",\n    \"ddd\": \"11\",\n    \"siafi\": \"7107\"\n});\n*/\n```\n\n### findByStreetName\n\nPesquise endereços usando estado, cidade e nome de uma rua.\n\n```php\nuse KSeven\\ViaCEP\\VCRun AS ViaCEP;\n\n$ViaCEP = new ViaCEP;\n\n$Addresses = $ViaCEP-\u003efindByStreetName('SP', 'São Paulo', 'Gomes de Carvalho');\n\n/*\nDeve retornar algo assim:\n\n[\n    [\n        'zipCode' =\u003e '01001-000',\n        'street' =\u003e 'Praça da Sé',\n        'complement' =\u003e 'lado ímpar',\n        'neighborhood' =\u003e 'Sé',\n        'city' =\u003e 'São Paulo',\n        'state' =\u003e 'SP',\n        'ibge' =\u003e '3550308',\n    ],\n    [\n        'zipCode' =\u003e '01001-000',\n        'street' =\u003e 'Praça da Sé',\n        'complement' =\u003e 'lado ímpar',\n        'neighborhood' =\u003e 'Sé',\n        'city' =\u003e 'São Paulo',\n        'state' =\u003e 'SP',\n        'ibge' =\u003e '3550308',\n    ]\n]\n*/\n```\n\n## Registo de alterações\n\nConsulte [CHANGELOG](CHANGELOG.md) para obter mais informações sobre o que mudou recentemente.\n\n## Contribuindos\n\nConsulte [CONTRIBUINDO](CONTRIBUINDO.md) e [CONDUTA](CONDUTA.md) para obter detalhes.\n\n## Segurança\n\nSe você descobrir algum problema relacionado à segurança, envie um e-mail para contato@kseven.dev.br em vez de usar o rastreador de problemas.\n\n## Credits\n\n- [K'Seven][link-author]\n- [All Contributors][link-contributors]\n\n## Licença\n\nA licença MIT (MIT). Consulte [Arquivo de licença](LICENSE.md) para obter mais informações..\n\n[ico-version]: https://img.shields.io/packagist/v/kseven/phpviacep.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/kseven/phpviacep.svg?style=flat-square\n[icon-circleci]: https://img.shields.io/circleci/project/github/kseven/phpviacep.svg?style=flat-square\n[icon-codecov]: https://img.shields.io/codecov/c/github/kseven/phpviacep.svg?style=flat-square\n\n[link-circleci]: https://circleci.com/gh/kseven/phpviacep\n[link-codecov]: https://codecov.io/gh/kseven/phpviacep\n[link-packagist]: https://packagist.org/packages/kseven/phpviacep\n[link-downloads]: https://packagist.org/packages/kseven/phpviacep\n[link-author]: https://github.com/KS7ven\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdevelopement%2Fphpviacep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdevelopement%2Fphpviacep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdevelopement%2Fphpviacep/lists"}