Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

@robtex/sdk

Lightweight SDK for the Robtex API. DNS, IP, AS, Bitcoin, and Lightning Network intelligence.

  • Zero dependencies
  • Plain ESM JavaScript with JSDoc types — no build step, no tsx, runs on plain node (>=20)
  • Editor IntelliSense via JSDoc (works in VS Code, WebStorm, Cursor, etc.)
  • Works everywhere: Node, Deno, Bun, Cloudflare Workers, browsers
  • 55 endpoints covering DNS, passive DNS, IP reputation, geolocation, BGP, domain analysis, Bitcoin, and Lightning Network

Install

npm install @robtex/sdk

Quick Start

import{Robtex}from'@robtex/sdk';constapi=newRobtex();// DNS lookupconstdns=awaitapi.lookupDns({hostname: 'google.com'});// IP reputation — check against 100+ blocklistsconstrep=awaitapi.ipReputation({ip: '8.8.8.8'});// Passive DNS — find all records for a domainconstpdns=awaitapi.pdnsForward({domain: 'example.com'});// Bitcoin address lookupconstaddr=awaitapi.lookupBitcoinAddress({address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'});

Authentication (Optional)

Works without any key (rate-limited to 10 req/hr). Three options for higher limits:

// Free — no key, 10 req/hrconstapi=newRobtex();// Pro API key — higher limitsconstapi=newRobtex({apiKey: 'your-key'});// RapidAPI key — managed billing, plans from $19/moconstapi=newRobtex({rapidApiKey: 'your-rapidapi-key'});

Get a RapidAPI key at https://rapidapi.com/robtex/api/robtex

Multi-step Investigation Example

import{Robtex}from'@robtex/sdk';constapi=newRobtex();// Investigate a domain: DNS + IP reputation + shared hostingconstdns=awaitapi.lookupDns({hostname: 'suspicious-site.com'});constip=dns.records.find(r=>r.type==='A')?.value;if(ip){const[reputation,shared,geo]=awaitPromise.all([api.ipReputation({ ip }),api.domainSharedIp({hostname: 'suspicious-site.com'}),api.ipGeolocation({ ip }),]);console.log({ dns, ip, reputation, shared, geo });}

All Methods

DNS

MethodDescription
lookupDns({ hostname })All DNS records for a hostname
dnsA({ hostname })A records
dnsAAAA({ hostname })AAAA records
dnsMx({ hostname })MX records
dnsNs({ hostname })NS records
dnsTxt({ hostname })TXT records
dnsCname({ hostname })CNAME records
dnsSoa({ hostname })SOA record
dnsPtr({ ip })PTR record for an IP

Reverse DNS

MethodDescription
reverseLookupDnsRecords({ value, type?, limit?, offset? })Hostnames using a DNS value
reverseLookupIp({ ip, limit?, offset? })Hostnames pointing to an IP
reverseLookupMx({ mx, limit?, offset? })Hostnames using a mail server
reverseLookupNs({ nameserver, limit?, offset? })Hostnames using a nameserver
reverseLookupCname({ target, limit?, offset? })Hostnames CNAMEd to a target

Historic Reverse DNS

MethodDescription
historicReverseLookupIp({ ip, limit?, offset? })Previously pointed to an IP
historicReverseLookupNs({ nameserver, limit?, offset? })Previously used a nameserver
historicReverseLookupMx({ mx, limit?, offset? })Previously used a mail server
historicReverseLookupCname({ target, limit?, offset? })Previously CNAMEd to a target

Passive DNS

MethodDescription
pdnsForward({ domain })Domain to DNS records (returns array)
pdnsReverse({ value, type? })Value to domains (returns array)
pdnsReverseHistoric({ value, type? })Historic reverse pDNS (returns array)

IP Intelligence

MethodDescription
ipReputation({ ip })Check against 100+ blocklists
ipGeolocation({ ip })Country, city, coordinates
ipNetwork({ ip })BGP route, ASN
ipToAsn({ ip })Map IP to AS number
ipBlocklistCheck({ ip })Threat intel blocklists (FireHOL, IPsum)
ipThreatIntel({ ip })AbuseIPDB, CIRCL BGP ranking

Legacy IP/AS

MethodDescription
ipquery({ ip })Classic IP query (DNS + geo + network)
asquery({ asn })Networks for an AS number

AS / Routing

MethodDescription
asInfo({ asn })AS name and organization
asPrefixes({ asn })Announced BGP prefixes
lookupAsWhois({ asn })AS WHOIS information

Domain Analysis

MethodDescription
domainReputation({ hostname })Reputation and threat data
domainRanking({ hostname })Popularity (Tranco, Majestic, Umbrella, CrUX)
domainBlocklistCheck({ hostname })DNS blocklist check
domainSharedIp({ hostname, limit? })Domains on same IP
domainSharedNs({ hostname, limit? })Domains with same nameservers
domainSharedMx({ hostname, limit? })Domains with same mail server

Hostname Utilities

MethodDescription
parseHostname({ hostname })Parse into eTLD, domain, subdomain
isSubdomain({ hostname })Check if subdomain
registeredDomain({ hostname })Extract registered domain
tldInfo({ tld })TLD information

Lightning Network

MethodDescription
lookupLightningNode({ pubkey })Node info by public key
lookupLightningChannel({ short_channel_id })Channel info
lookupLightningChannelsPerNode({ pubkey, limit?, offset? })Channels for a node
getRecommendedLightningPeers({ pubkey, count? })Peer recommendations
searchLightningNodesByAlias({ alias, limit? })Search nodes by name
latestLightningChannels({ count? })Recently opened channels

Bitcoin

MethodDescription
lookupBitcoinTransaction({ txid })Transaction details
lookupBitcoinAddress({ address })Address info and balance
lookupBitcoinBlock({ height })Block details
bitcoinAddressTransactions({ address, limit?, offset? })Transaction history
bitcoinTransactionSpends({ txid })Spending transactions
bitcoinBlockchainStats({ start_height, end_height })Block range statistics

Utility

MethodDescription
lookupMac({ mac })MAC address vendor (IEEE OUI)
checkEmail({ email })Email verification via SMTP
ping()API health check

Generic Call

For any endpoint, including future ones:

constresult=awaitapi.call('some_endpoint',{param1: 'value'});

Error Handling

import{Robtex,RobtexError}from'@robtex/sdk';constapi=newRobtex();try{awaitapi.ipReputation({ip: '8.8.8.8'});}catch(e){if(einstanceofRobtexError&&e.status===429){console.log(`Rate limited. Retry after ${e.retryAfter}s`);}}

Custom Fetch

Pass your own fetch for proxies, logging, or testing:

constapi=newRobtex({fetch: (url,init)=>{console.log('Fetching:',url);returnglobalThis.fetch(url,init);},});

Links

License

MIT

About

Lightweight TypeScript SDK for the Robtex API — DNS, IP, Bitcoin, Lightning Network intelligence

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages