PHP Classes

GeoNames PHP API: Search for geographic places using GeoNames API

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 74 All time: 10,198 This week: 455Up
Version License PHP version Categories
geo-name-search 1.0GNU General Publi...5PHP 5, Searching, Web services, Geogr...


This class can search for geographic places using GeoNames API.

It can send HTTP requests to the GeoNames API Web server to perform searches for geographic locations.

Currently, it can retrieve the:

- States of a given country

- Cities with a given name

The class can cache the query results to avoid calling the GeoNames API multiple times to query the same information.

Picture of Ujah Chigozie peter
  Performance   Level  
Name: Ujah Chigozie peter <contact>
Classes: 24 packages by
Country: Nigeria Nigeria
Age: 33
All time rank: 202510 in Nigeria Nigeria
Week rank: 31 Up3 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 11x



Php Geoname search wrapper, to help reduce too much api call


Installation is super-easy via Composer:

composer require peterujah/geo-name-search


First you have to create an account with geoname to acquire api username

Initialize GeoNameSearch with geoname api username

$geo = new \Peterujah\NanoBlock\GeoNameSearch("username");

List all states in any country Nigeria


List all cities in any sates Enugu


Search geoname with query and country

$geo->query("Query", "Country");

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file GeoNameSearch.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,198
This week:455Up