{"id":24211186,"url":"https://github.com/ipdata/node","last_synced_at":"2025-09-22T07:32:07.836Z","repository":{"id":44177595,"uuid":"113612713","full_name":"ipdata/node","owner":"ipdata","description":"Official NodeJS client library for the ipdata API","archived":false,"fork":false,"pushed_at":"2024-04-10T09:20:50.000Z","size":1035,"stargazers_count":16,"open_issues_count":10,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-21T05:32:24.222Z","etag":null,"topics":["geolocation","geolocation-api","ipdata","nodejs"],"latest_commit_sha":null,"homepage":"https://ipdata.co","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-08T20:04:09.000Z","updated_at":"2025-04-09T10:12:24.000Z","dependencies_parsed_at":"2023-12-19T01:02:23.565Z","dependency_job_id":"9777edeb-8f7c-4889-89ca-0ef45f33ab27","html_url":"https://github.com/ipdata/node","commit_stats":{"total_commits":98,"total_committers":2,"mean_commits":49.0,"dds":"0.020408163265306145","last_synced_commit":"b820c02a2ae9f4d3f79eddba84e5b9006dba40d1"},"previous_names":["thomasconner/ipdata-js-library"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ipdata/node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipdata","download_url":"https://codeload.github.com/ipdata/node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fnode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276367062,"owners_count":25629964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation","geolocation-api","ipdata","nodejs"],"created_at":"2025-01-14T02:19:57.317Z","updated_at":"2025-09-22T07:32:07.578Z","avatar_url":"https://github.com/ipdata.png","language":"TypeScript","readme":"# IPData JavaScript Library\n\n[![](https://github.com/ConnerTechnology/ipdata-js-library/workflows/CI/badge.svg)](https://github.com/ConnerTechnology/ipdata-js-library/actions)\n\nJavaScript library that can be used in a web browser or Node.js application to gather information for an IP address using https://ipdata.co.\n\n**Table of Contents**\n\n- [Install](#install)\n- [Use](#use)\n  - [Import Library](#import-library)\n  - [Create an Instance](#create-an-instance)\n  - [Lookup](#lookup)\n  - [Bulk Lookup](#bulk-lookup)\n\n## Install\n\n```sh\n$ npm install ipdata\n```\n\n## Use\n\n### Import library\n\nImport the library.\n\n```js\nimport IPData from 'ipdata';\n```\n\n**Note:** If you are using `require()` then you will need to use the default value exported from the library.\n\n```js\nconst IPData = require('ipdata').default;\n```\n\n### Create an Instance\n\nCreate an instance of the `IPData` class and pass your api key for IPData as the first parameter.\n\n```js\nconst ipdata = new IPData('\u003capiKey\u003e');\n```\n\nThe library will cache 4096 ip addresses responses for 24 hours using a LRU cache by default. You can configure the cache by passing an object as the second paramenter.\n\n```js\nconst cacheConfig = {\n  max: 1000, // max size\n  maxAge: 10 * 60 * 1000, // max age in ms (i.e. 10 minutes)\n};\nconst ipdata = new IPData('\u003capiKey\u003e', cacheConfig);\n```\n\n**Note:** To disable the cache pass `-1` as the `maxAge`.\n\n```js\nconst cacheConfig = {\n  maxAge: -1, // disable the cache\n};\nconst ipdata = new IPData('\u003capiKey\u003e', cacheConfig);\n```\n\n### Lookup\n\nThe library will lookup the ip address of the host computer if no ip address is provided.\n\n```js\nipdata.lookup()\n  .then(function(info) {\n    // info.ip === '\u003chostcomputerip\u003e'\n    // ...\n  });\n```\n\nYou can pass an ip address as the first parameter to the `lookup()` method to lookup information about the ip address using IPData.\n\n```js\nconst ip = '1.1.1.1';\nipdata.lookup(ip)\n  .then(function(info) {\n    // info.ip === 1.1.1.1\n    // ...\n  });\n```\n\nYou can specify only a select field to be returned when looking up an ip address by passing a field as the second parameter to the `lookup()` method.\n\n```js\nconst ip = '1.1.1.1';\nconst selectField = 'ip';\nipdata.lookup(ip, selectField)\n  .then(function(info) {\n    // info.select_field === 1.1.1.1\n    // ...\n  });\n```\n\nYou can specify only certain fields to be returned when looking up an ip address by passing an array of fields as the third parameter to the `lookup()` method.\n\n```js\nconst ip = '1.1.1.1';\nconst fields = ['ip', 'city'];\nipdata.lookup(ip, null, fields)\n  .then(function(info) {\n    // ...\n  });\n```\n\n### Bulk Lookup\n\nYou can lookup multiple ip addresses with one API call using the `bulkLookup()` method.\n\n```js\nconst ips = ['1.1.1.1', '1.0.0.1'];\nipdata.bulkLookup(ips)\n  .then(function(info) {\n    // info[0].ip === 1.1.1.1\n    // ...\n  });\n```\n\nYou can specify only certain fields to be returned when looking up multiple ip addresses by passing an array of fields as the second parameter to the `bulkLookup()` method.\n\n```js\nconst ips = ['1.1.1.1', '1.0.0.1'];\nconst fields = ['ip', 'city'];\nipdata.bulkLookup(ips, fields)\n  .then(function(info) {\n    // ...\n  });\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipdata%2Fnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipdata%2Fnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipdata%2Fnode/lists"}