https://github.com/geocodefarm/geocodefarm-js
JavaScript SDK for the Geocode.Farm API
https://github.com/geocodefarm/geocodefarm-js
geocode geocode-farm geocodefarm geocoder geocoder-api geocoder-library geocoding geocoding-api geocoding-library geocoding-service geocoding-services javascript javascript-library js js-library js-sdk sdk sdk-javascript sdk-js
Last synced: 11 months ago
JSON representation
JavaScript SDK for the Geocode.Farm API
- Host: GitHub
- URL: https://github.com/geocodefarm/geocodefarm-js
- Owner: geocodefarm
- License: unlicense
- Created: 2025-04-05T18:11:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T18:14:55.000Z (about 1 year ago)
- Last Synced: 2025-06-06T15:35:12.466Z (12 months ago)
- Topics: geocode, geocode-farm, geocodefarm, geocoder, geocoder-api, geocoder-library, geocoding, geocoding-api, geocoding-library, geocoding-service, geocoding-services, javascript, javascript-library, js, js-library, js-sdk, sdk, sdk-javascript, sdk-js
- Language: JavaScript
- Homepage: https://geocode.farm
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Geocode.Farm JavaScript SDK
## Introduction
The official JavaScript SDK for the Geocode.Farm API.
This SDK allows you to easily integrate geocoding (both forward and reverse) into your JavaScript applications.
## Installation
You can include the `geocodefarm.js` file directly in your HTML project, or install it through package managers like npm or yarn.
To use the SDK, simply include the script and initialize it with your API key.
## Example Usage
```html
const geocode = new GeocodeFarm('your_api_key_here');
// Example: Forward geocoding
geocode.forward('1600 Pennsylvania Ave, Washington, DC').then(response => {
if (response.success) {
console.log('Coordinates:', response.lat, response.lon);
} else {
console.error('Error:', response.error);
}
});
// Example: Reverse geocoding
geocode.reverse(38.8977, -77.0365).then(response => {
if (response.success) {
console.log('Address:', response.full_address);
} else {
console.error('Error:', response.error);
}
});
```
## License
This SDK is licensed under **The Unlicense** (public domain).
## Contributing
If you find any bugs or have suggestions, please submit an issue or a pull request.