# astroip-typescript

> Official Typescript / Javascript SDK for AstroIP.co Geolocation API

Latest version **1.0.4** (published 2020-11-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install astroip-typescript
pnpm add astroip-typescript
yarn add astroip-typescript
bun add astroip-typescript
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-11-18 |
| First published | 2020-11-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | astroip-co |
| Maintainers | astroip-co |
| Keywords | geolocation, API, maxmind, ip2location, ipdata, asn, lookup, ipinfo, ipinfodb, ipthreat, ipv4, ipv6, ip, country, currency, timezone, useragent, ipaddress, es7, nodejs, typescript |

## Links

- npm: https://www.npmjs.com/package/astroip-typescript
- Repository: https://github.com/astroip-co/astroip-typescript
- Homepage: https://github.com/astroip-co/astroip-typescript#readme
- Issues: https://github.com/astroip-co/astroip-typescript/issues
- npm.io page: https://npm.io/package/astroip-typescript

## Dependencies (5)

- [is-ip](https://npm.io/package/is-ip.md) ^3.1.0
- [ts-node](https://npm.io/package/ts-node.md) ^9.0.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^6.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [typescript](https://npm.io/package/typescript.md) ^4.0.5

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2020-11-18
- 1.0.3 — 2020-11-18
- 1.0.2 — 2020-11-18
- 1.0.1 — 2020-11-18
- 1.0.0 — 2020-11-18

## README

# AstroIP.co Official Typescript library

This is the official Javascript Library for AstroIP.co, which allows a fast lookup of any IP address or ASN. Our main features are:

- IP Geolocation data (country, city, postal codes, latitude, longitude)

- Timezone data

- Currency data

- Security data (TOR insights, Crawler insights, Proxy insigths)

- ASN data (number of IPs managed by an ASN, the organization name, the list of IP blocks managed by a given ASN, service type like isp, gov, edu, etc..)

- User Agent detection

## Getting started
In order to use AstroIP.co API, you will need to register a free account at https://astroip.co and get an API KEY. All data fields are always enabled regardless of the subscription tier.

The Free tier will allow up to 30,000 requests a month.
The PRO tier will allow for up to 3 Mil requests a month.
More pricing info are available at: https://astroip.co/#pricing-section

## Installation
Npm
   ```
   $ npm i astroip-typescript
   ```
Yarn
   ```
    $ yarn add astroip-typescript
   ```

## Usage example
IP Lookup:
 ```
  const {AstroIP} = require("astroip-typescript")
 
  let testApiKey = '1725E47C-1486-4369-AAFF-463CC9764026';
  const client = new AstroIP(testApiKey);
  let hostname = true;
  let userAgent = true;
  let ipInfo = await client.lookupIP('8.8.8.8', hostname, userAgent);
  console.log(ipInfo);
 ```
ASN Lookup:
 ```
  const {AstroIP} = require("astroip-typescript")
  
  let testApiKey = '1725E47C-1486-4369-AAFF-463CC9764026';
  const client = new AstroIP(testApiKey);
  let asnInfo = await client.lookupASN("AS15169");
  console.log(asnInfo);
 ```

---
_Source: https://npm.io/package/astroip-typescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
