Neutralize Pesky Miscreants
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.2 • Public • Published

    IP to Location (Node.js and browser) website status Uptime Robot status Uptime Robot ratio (30 days) Snyk Vulnerabilities for npm package GitHub issues npm downloads GitHub code size in bytes GitHub top language NPM licence npm version

    Find geolocation data from IP addresses (e.g. city, country, lat/long) using the API. provides 5.000 free requests per month. For higher plans, check out the website


    You need to get your API key from here: and you'll get 5.000 free requests/month

    Install the package with:

    npm install
    # or
    yarn add


    The package needs to be configured with your account's API key, which is available in the Dashboard

    const apiip = require('')('YOUR_API_KEY');
      .then((results) => console.log(results))
      .catch((error) => console.error(error));

    Or using ES6 modules and async/await:

    import Apiip from '';
    const apiip = Apiip('YOUR_API_KEY');
    (async () => {
      console.log(await apiip.getLocation());

    HTTPS Encryption

    By default, the SSL/TLS is turned off, if you want to enable it just pass the options parameter


    const apiip = require('')('YOUR_API_KEY', { ssl: true });

    Or using ES6 module import

    import Apiip from '';
    const apiip = Apiip('YOUR_API_KEY', { ssl: true });


    Call getLocation method with config object

    const apiip = require('')('YOUR_API_KEY', { ssl: true });
        ip: '', // ',,' - for bulk request
        output: 'xml',
        fields: 'city, countryName,',
        languages: 'es',
      .then((results) => console.log(results))
      .catch((error) => console.error(error));
    Option Type Description Default
    ip string Optional. Get location about the specify IP or multiple IPs. Requester IP
    output string Optional. Specify response format, XML or JSON. JSON
    fields string Optional. Specify response fields. All fields
    languages string Optional. Specify response language. EN
    callback string Optional. The callback function name (JSONP Callbacks) -

    Example complete response

      "ip": "",
      "continentCode": "NA",
      "continentName": "North America",
      "countryCode": "US",
      "countryName": "United States",
      "countryNameNative": "United States",
      "city": "New York",
      "postalCode": "10001",
      "latitude": 40.8271,
      "longitude": -73.9359,
      "capital": "Washington D.C.",
      "phoneCode": "1",
      "countryFlagEmoj": "🇺🇸",
      "countryFlagEmojUnicode": "U+1F1FA U+1F1F8",
      "isEu": false,
      "borders": [
      "topLevelDomains": [
      "languages": {
        "en": {
          "code": "en",
          "name": "English",
          "native": "English"
      "currency": {
        "code": "USD",
        "name": "US Dollar",
        "symbol": "$",
        "number": "840",
        "rates": {
          "EURUSD": 1.11
      "timeZone": {
        "id": "America/New_York",
        "currentTime": "10/26/2021, 2:54:10 PM",
        "code": "EDT",
        "timeZoneName": "EDT",
        "utcOffset": -14400
       "userAgent": {
        "isMobile": false,
        "isiPod": false,
        "isTablet": false,
        "isDesktop": true,
        "isSmartTV": false,
        "isRaspberry": false,
        "isBot": false,
        "browser": "Chrome",
        "browserVersion": "100.0.4896.127",
        "operatingSystem": "Windows 10.0",
        "platform": "Microsoft Windows",
        "source": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
      "connection": {
        "asn": 12271,
        "isp": "Charter Communications Inc"
      "security": {
        "isPublicProxy": false,
        "isResidentialProxy": false,
        "isTorExitNode": false,
        "network": ""

    More Information


    npm i


    DownloadsWeekly Downloads





    Apache License v2

    Unpacked Size

    26.5 kB

    Total Files


    Last publish


    • apiipnet