Home
Contents

CountryWhois SDK

 
CountryWhois SDK
About CountryWhois SDK
Using CountryWhois SDK
Functions for Obtaining the Country ID
SWAPI_IPAddressToCountryID
SWAPI_IPStringToCountryID
SWAPI_CountryCodeToCountryID
SWAPI_GetMinCountryID
SWAPI_GetMaxCountryID
Functions for Obtaining Information About a Country
SWAPI_CountryIDToCountryCode
SWAPI_CountryIDToCountryName
SWAPI_CountryIDToContinentCode
SWAPI_CountryIDToContinentName
SWAPI_GetCountryCodeStatus
SWAPI_GetCountryCodeIndex
SWAPI_EnumCountryIPRanges
EnumIPRangesProc
Functions for Obtaining the Continent ID
SWAPI_CountryIDToContinentID
SWAPI_ContinentCodeToContinentID
SWAPI_GetMinContinentID
SWAPI_GetMaxContinentID
Functions for Obtaining Information About a Continent
SWAPI_ContinentIDToContinentCode
SWAPI_ContinentIDToContinentName
SWAPI_EnumContinentIPRanges
SWAPI_EnumContinentCountries
EnumCountriesProc
Country Flags
SWAPI_GetCountryFlagBitmap
SWAPI_GetCountryFlagsImageList
SWAPI_GetCountryFlagsImageListEx
SWAPI_GetCountryFlagsImageListIndex
SWAPI_DestroyCountryFlagsImageList

Using CountryWhois SDK

The SDK includes swapimap.dll that includes the IP-to-country database and exports a set of functions that allows you to utilize this database in your application. The SDK functions fall into the following four categories (see the corresponding section of this document for the function list and usage examples):

Functions for Obtaining the Country ID
Functions for Obtaining Information About a Country
Functions for Obtaining the Continent ID
Functions for Obtaining Information About a Continent


You can start using CountryWhois SDK as easy as 1-2-3:

  1. Get the country ID by IP address using the SWAPI_IPAddressToCountryID or SWAPI_IPStringToCountryID functions.
  2. Once you have obtained the ID, get the country name or ISO 3166-1 code using the SWAPI_CountryIDToCountryCode or SWAPI_CountryIDToCountryName functions.
  3. You're done. You've determined the country by IP address.


It's important to understand that IP address allocation is constantly changing. Every day, new IP addresses are assigned or re-allocated. As time passes, the accuracy of the database rapidly declines, so in a few months a substantial percentage of IP addresses will be incorrectly identified unless you regularly download the latest swapimap.dll. The latest, regularly updated swapimap.dll is available in the CountryWhois DB Subscriber's Area.


Copyright © 2006-2008, TamoSoft