Download the PHP package geocodio/geocodio-library-php without Composer
On this page you can find all versions of the php package geocodio/geocodio-library-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download geocodio/geocodio-library-php
More information about geocodio/geocodio-library-php
Files in geocodio/geocodio-library-php
Package geocodio-library-php
Short Description geocod.io geocoding API library
License MIT
Homepage https://github.com/geocodio/geocodio-library-php
Informations about the package geocodio-library-php
geocod.io PHP library
Library for performing forward and reverse address geocoding for addresses or coordinates in the US and Canada.
- Installation
- Usage
- Single geocoding
- Batch geocoding
- Field appends
- Address components
- Limit results
- Uploading Lists
- Upload list from a file
- Upload list of inline data
- List processing status
- Download a list
- Fetch all uploaded lists
- Delete uploaded list
- Usage with Laravel
- Testing
- Changelog
- Security
- License
Installation
You can install the package via composer:
Using Laravel? Great! There's an optional Laravel service provider, for easy integration into your app.
Usage
Don't have an API key yet? Sign up at https://dash.geocod.io to get an API key. The first 2,500 lookups per day are free.
Single geocoding
Using the Laravel integration? Check out Laravel-specific usage examples below.
Note: You can read more about accuracy scores, accuracy types, input formats and more at https://www.geocod.io/docs/
Batch geocoding
To batch geocode, simply pass an array of addresses or coordinates instead of a single string
Field appends
Geocodio allows you to append additional data points such as congressional districts, census codes, timezone, ACS survey results and much much more.
To request additional fields, simply supply them as an array as the second parameter
Address components
For forward geocoding requests it is possible to supply individual address components instead of a full address string. This works for both single and batch geocoding requests.
Limit results
Optionally limit the number of maximum geocoding results by using the third parameter on geocode(...)
or reverse(...)
Uploading Lists
The lists API lets you upload and process spreadsheet with addresses or coordinates. Similar to the spreadsheet feature in the dashboard, the spreadsheet will be processed as a job on Geocodio's infrastructure and can be downloaded at a later time. While a spreadsheet is being processed it is possible to query the status and progress.
[!IMPORTANT] Data for spreadsheets processed through the lists API are automatically deleted 72 hours after they have finished processing. In addition to a 1GB file size limit, we recommend a maximum of 10M lookups per list batch. Larger batches should be split up into multiple list jobs.
See the API docs for geocoding lists for additional details.
Upload list from a file
Creates a new spreadsheet list job and starts processing the list in the background. The response returns a list id that can be used to retrieve the job progress as well as download the processed list when it has completed.
Upload list of inline data
List status
View the metadata and status for a single uploaded list.
Download a list
Download a fully geocoded list, the returned format will always be a UTF-8 encoded, comma-separated csv file.
Fetch all uploaded lists
Show all lists that have been created. The endpoint is paginated, showing 15 lists at a time, ordered by recency.
Delete uploaded list
Delete a previously uploaded list and its underlying spreadsheet data permanently. This can also be used to cancel and delete a spreadsheet that is currently processing.
Geocodio Unlimited customers can cancel a spreadsheet at any time. Pay as You Go customers can only cancel a spreadsheet if it was just recently started.
The spreadsheet data will always be deleted automatically after 72 hours if it is not deleted manually first.
Usage with Laravel
This library works well without Laravel, but if you happen to be using Laravel you can enjoy a few Laravel-specific features.
The package will be auto-discovered by newer Laravel versions, so the only thing left to do is to publish the config file
You can now go ahead and edit your config file at config/geocodio.php
.
You will now be able to use the Geocodio
facade, or dependency inject the fully-configured Geocodio
class.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.