• Stars
    star
    510
  • Rank 86,627 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TruecallerJS: This is a library for retrieving phone number details using the Truecaller API.

TruecallerJS

NPM version GIT Stars Download LICENSE Maintenance Issues jsdelivr

  • TruecallerJS is a node.js/javascript library to get the details of a phone number.

Description

  • TruecallerJS is a node.js/javascript library to get the details of a phone number.

Command Line Usage

Requirements

Installation

Install this npm package globally.

Stable version:

npm install -g  truecallerjs
  • Run truecallerjs with --help to see the help for truecallerjs.
~$ truecallerjs --help
Usage:

truecallerjs  login (Login to truecaller).
truecallerjs -s [number] (command to search a number).

Options:
      --version           Show version number                          [boolean]
  -s, --search            To search caller name and related information of a num
                          ber
  -r, --raw               Print's raw output                           [boolean]
      --bulksearch, --bs  Make a bulk number search
  -n, --name              Print's user name of phone number            [boolean]
  -e, --email             Print's email assigned to the phonenumber    [boolean]
      --json              print's  output in json                      [boolean]
      --xml               print's  output in XML                       [boolean]
      --yaml              Print's  output in YAML                      [boolean]
      --text              Print's  output as plain text(TXT)           [boolean]
      --html              Print's html table                           [boolean]
      --nc, --no_color    Print without color                          [boolean]
  -i, --installationid    shows your InstallationId                    [boolean]
  -v, --verbose           Show additional information                    [count]
  -h, --help              Show help                                    [boolean]

  Example:
      ~$ truecallerjs -s +9199123456789 --json          {....}
      ~$ truecallerjs -s +9199123456789 --name          Sumith Emmadi

  https://github.com/sumithemmadi/truecallerjs.git

Note : If you are using truecallerjs version less than 1.1.2. follow truecallerjs-v1.1.2 documentation.

Note : If you are using truecallerjs version from 1.1.3 to 1.1.5. follow truecallerjs-v1.1.5 documentation.

Login

Then login to your truecaller account .

~$ truecallerjs login

If you get any error, try running 'sudo truecallerjs login'. If you are using Windows try the command with Adminitrative Privilege.

InstallationId

Enter the below command to see your InstallationId.

truecallerjs --installationid

Print only installation Id.

truecallerjs -i -r

Searching a number

~$ truecallerjs -s [number]
data                : 
id                  : jsiebejebbeebhee/dnss00w==
name                : Sumith Emmadi
imId                : 1g7rm006b356o
gender              : UNKNOWN
image               : https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb
score               : 0.9
access              : PUBLIC
enhanced            : true
phones              : 
e164Format          : +000000000000
numberType          : MOBILE
nationalFormat      : +000000000000
dialingCode         : 91
countryCode         : IN
carrier             : Airtel
type                : openPhone
addresses           : 
city                : Andhra Pradesh
countryCode         : IN
timeZone            : +05:30
type                : address
internetAddresses   : 
id                  : [email protected]
service             : email
caption             : Sumith Emmadi
type                : internetAddress
badges              : verified, user
cacheTtl            :
sources             : []
searchWarnings      : []
surveys             : []
provider            : ss-nu
stats               :
sourceStats         : []

To make a bulk number search

~$ truecallerjs --bs [Numbers seperated by comma]

Example :

 ~$ truecallerjs --bs 9912345678,+14051234567,+919987654321
  • raw output
~$ truecallerjs --bs 9912345678,+14051234567,+919987654321 -r 
  • no color
~$ truecallerjs --bs 9912345678,+14051234567,+919987654321 --nc

To print only name.

~$ truecallerjs -s [number] --name

Name : Sumith Emmadi

Other command's

~$ truecallerjs -s [number] -r --name

Sumith Emmadi

Output Formats

  • 1 . JSON
  • 2 . XML
  • 3 . YAML
  • 4 . TEXT
  • 5 . HTML
  • Example :
~$ truecallerjs -s [number] --text
  • Output without colouring
~$ truecallerjs -s [number] --text --nc

To get only JSON output

~$ truecallerjs -s [number] --json
~$ truecallerjs -s [number] --json
  • Prints data without color
~$ truecallerjs -s [number] --json --nc

To get XML output

~$ truecallerjs -s [number] --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<root>
  <data>
    <id>jsiebejebbeebhee/dnss00w==</id>
    <name>Sumith Emmadi</name>
    <imId>1g7rm006b356o</imId>
    <gender>UNKNOWN</gender>
    <image>https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb</image>
    <score>0.9</score>
    <access>PUBLIC</access>
    <enhanced>true</enhanced>
    <phones>
      <e164Format>+000000000000</e164Format>
      <numberType>MOBILE</numberType>
      <nationalFormat>+000000000000</nationalFormat>
      <dialingCode>91</dialingCode>
      <countryCode>IN</countryCode>
      <carrier>Airtel</carrier>
      <type>openPhone</type>
    </phones>
    <addresses>
      <city>Andhra Pradesh</city>
      <countryCode>IN</countryCode>
      <timeZone>+05:30</timeZone>
      <type>address</type>
    </addresses>
    <internetAddresses>
      <id>[email protected]</id>
      <service>email</service>
      <caption>Sumith Emmadi</caption>
      <type>internetAddress</type>
    </internetAddresses>
    <badges>verified</badges>
    <badges>user</badges>
    <cacheTtl>
    </cacheTtl>
    <sources/>
    <searchWarnings/>
    <surveys/>
  </data>
  <provider>ss-nu</provider>
  <stats>
    <sourceStats/>
  </stats>
</root>

To get YAML output

~$ truecallerjs -s [number] --yaml
data: 
 - 
   id: "jsiebejebbeebhee/dnss00w=="
  name: "Sumith Emmadi"
  imId: 1g7rm006b356o
  gender: UNKNOWN
  image: "https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb"
  score: 0.9
  access: PUBLIC
  enhanced: true
  phones: 
   - 
   e164Format: "+000000000000"
    numberType: MOBILE
    nationalFormat: "+000000000000"
    dialingCode: 91
    countryCode: IN
    carrier: "Airtel"
    type: openPhone
  addresses: 
   - 
   city: "Andhra Pradesh"
    countryCode: IN
    timeZone: "+05:30"
    type: address
  internetAddresses: 
   - 
   id: "[email protected]"
    service: email
    caption: "Sumith Emmadi"
    type: internetAddress
  badges: 
   - 
   verified
   - 
   user
  tags: 
  nameFeedback: 
   nameSource: 1
   nameElectionAlgo: ""
  cacheTtl: ""
  sources: 
  searchWarnings: 
  surveys: 
provider: "ss-nu"
stats: 
 sourceStats: 

To get output as a plain text

~$ truecallerjs -s [number] --text

To get HTML output

~$ truecallerjs -s [number] --html

Usage

npm install truecallerjs

Simple Example

  • Normal search for a phone number.
import truecallerjs from "truecallerjs";

var search_data = {
  number: "9912345678",
  countryCode: "IN",
  installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
};

var response = await truecallerjs.search(search_data);
console.log(response.json());

// response.json() 
// response.xml()
// response.yaml()
// response.html()
// response.text()

// response.getName() => "Sumith Emmadi"
// response.getAlternateName() => "sumith"  
// response.getAddresses() => {....}
// response.getEmailId() => [email protected]
// response.getCountryDetails() => {...}
  • number: Phone number
  • countryCode: Country code to use by default If any phone number is not in e164 format(Internation format). Eg: Country code for india is "IN".
  • installationId: InstallationId Here , You need to login first to use it. use truecallerjs login command to login to your account

Note : use truecallerjs -i command to get your installation id.

  • Bulk search on Multiple phone number.
import truecallerjs from "truecallerjs";


var countryCode = "IN";
var installationId = "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug";
var phoneNumbers = "+9912345678,+14051234567,+919987654321"; // Phone numbers seperated by comma's

var response = await truecallerjs.bulkSearch(
  phoneNumbers,
  countryCode,
  installationId
);
console.log(response);
  • phoneNumbers phone number separted with coma.

  • countryCode Country code to use by default If any phone number is not in e164 format(Internation format). Eg: Country code for india is "IN".

  • installationId 6-digits OTP. this should be a string.

  • Follow this documentation for more details https://github.com/sumithemmadi/truecallerjs/tree/main/docs

Implement Login function

import truecallerjs from "truecallerjs";

var json_data = await truecallerjs.login("+9199123456789"); // Phone number should be in international format and it must be a string

// {
//     "status": 1,
//     "message": "Sent",
//     "domain": "noneu",
//     "parsedPhoneNumber": 919912345678,
//     "parsedCountryCode": "IN",
//     "requestId": "6fe0eba6-acds-24dc-66de-15b3fba349c3",
//     "method": "sms",
//     "tokenTtl": 300
// }
  • Save this json in a file or store in a variable. This json will be used to verify OTP in verifyOtp() function.

  • Verifying OTP.

import truecallerjs from "truecallerjs";

var json_data = await truecallerjs.login("+9199123456789"); // Phone number should be in international format and it must be a string

var otp = "145214"; /* OTP is here*/

var data = await truecallerjs.verifyOtp(phonenumber, json_data, otp);

console.log(data);

// {
//    "status": 2,
//    "message": "Verified",
//    "installationId": "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
//    "ttl": 259200,
//    "userId": 1234567890123456789,
//    "suspended": false,
//    "phones": [
//       {
//          "phoneNumber": 919912857147,
//          "countryCode": "IN",
//          "priority": 1
//       }
//    ]
// }

License

MIT License

Copyright (c) 2021 Emmadi Sumith Kumar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

More Repositories

1

truecallerpy

A python module to search phone number details
Python
119
star
2

truecaller-on-termux

A simple truecaller for termux
Shell
73
star
3

bhimupijs

BHIMUPIJS is a npm module which can validate, verify and generate QR Codes for UPI IDs.
TypeScript
38
star
4

Tor-Onion-Service-On-Heroku

Host Onion services in dark web using Heroku CLI
CSS
37
star
5

tor-hidden-service-on-heroku

Host Tor v3 Hidden services in dark web on Heroku
JavaScript
23
star
6

sumithemmadi

My Profile
22
star
7

ArchLinux-Installation-Guide

This is a guide for arch linux installation with Openbox Window Managers
21
star
8

rosebot

My Personal Bot
PHP
20
star
9

ghost-over-tor-on-heroku

Host your Ghost blog in dark web on heroku
JavaScript
20
star
10

dialogflow-php

Get dialogflow fullfilment message in PHP
PHP
18
star
11

json-to-plain-text

json-to-plain-text is a npm module that converts JSON-like data or plain JavaScript objects to a formatted plain text representation.
TypeScript
18
star
12

Ruby-Hidden-Service

Host a website in dark web with heroku
HTML
17
star
13

my-termux-theme

Termux-theme
Shell
17
star
14

apk-get

install apks with command
C++
13
star
15

dotfiles

My personal dotfiles
Shell
13
star
16

ironman-bootanimation

This is my bootanimation for poco f1
11
star
17

sms-chatbot

Created a sms chatbot
Python
11
star
18

chatbot-nodejs

JavaScript
10
star
19

EasyOpenboxWM

A simple script for openbox window manager
CSS
10
star
20

totpjs

totpjs is a cli which generate 2FA One Time Passwords.
JavaScript
9
star
21

OnlineVotingSystem

Online Voting System
PHP
9
star
22

portfolio

My portfolio
HTML
8
star
23

beef-xss

AUR beef-xss
Shell
6
star
24

MyApplication

Java
6
star
25

truecallerjs-site

JavaScript
3
star
26

wa-profile

JavaScript
3
star
27

virtual-classroom

JavaScript
2
star
28

react-portfolio

Portfolio in react
HTML
2
star
29

coding-playground

A coding playground
JavaScript
2
star
30

reverse_engineered_apk

sldkvnz;ksjvn;kjsvS
Java
1
star
31

computer_graphics_assignments

C++
1
star
32

e-commerce-chatbot

e-commerce-chatbot
Python
1
star
33

ticketing-system

TypeScript
1
star