const truecallerjs = require('truecallerjs');
var searchData = {
number: "[PHONE_NUMBER]",
countryCode: "[COUNTRY_CODE]",
installationId: "[INSTALLATION_ID]"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
If you want output in different format's.
const truecallerjs = require('truecallerjs');
var searchData = {
number: "[PHONE_NUMBER]",
countryCode: "[COUNTRY_CODE]",
installationId: "[INSTALLATION_ID]",
output: "[FORMAT]"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
PHONE_NUMBER : Number you want to search.
COUNTRY_CODE : Country code you want to use by default . If mobile number is not in E164(International Format) Format then COUNTRY_CODE will be considered as a country code of that Mobile Number.
FORMAT : Format of the output.
1 . JSON
2 . XML
3 . YAML
4 . TEXT
5 . HTML
INSTALLATION_ID : To know your InstallationId , install the package globally.
Enter the below command to see your InstallationId.
truecallerjs --installationid
Examples
Example for JSON response.
const truecallerjs = require('truecallerjs');
var searchData = {
number: "9912345678",
countryCode: "IN",
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
output: "JSON"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
Here mobile number is in national format and country code is indian.
So india is considered as a country code of that mobile number and response will be json format.
Example for XML response.
const truecallerjs = require('truecallerjs');
var searchData = {
number: "+12093031250",
countryCode: "IN",
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
output: "XML"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
Here mobile number is in international format. So it is a US number.
Example for YAML response
const truecallerjs = require('truecallerjs');
var searchData = {
number: "09912345678",
countryCode: "IN",
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
output: "YAML"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
Example for TEXT response
const truecallerjs = require('truecallerjs');
var searchData = {
number: "09912345678",
countryCode: "IN",
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
output: "TEXT"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
Example for HTML Table
const truecallerjs = require('truecallerjs');
var searchData = {
number: "09912345678",
countryCode: "IN",
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
output: "HTML"
}
var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
console.log(response)
});
Make a bulk search in your project.
const truecallerjs = require('truecallerjs');
var countryCode = "IN";
var installationId = "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug";
var phoneNumbers = "+9912345678,+14051234567,+919987654321" // Phone numbers seperated by comma's
const searchResult = truecallerjs.bulkSearch(phoneNumbers,countryCode,installationId)
searchResult.then(function (response) {
const data = JSON.stringify(response, null, 2);
console.log(data);
})
Truecallerjs
Requirements
Command Line Usage
Installation
Install this npm package globally.
Login
Then login to your truecaller account .
setting's
.Privacy Center
and then click onDownload my data
.InstallationId
Enter the below command to see your InstallationId.
Print only installation Id.
Searching a number
To get raw output.
To make a bulk number search
To print only name.
Other command's
Output Formats
To get only JSON output
To get XML output
To get YAML output
To get output as a plain text
To get HTML output
Basic Usage
Usage
If you want output in different format's.
PHONE_NUMBER : Number you want to search.
COUNTRY_CODE : Country code you want to use by default . If mobile number is not in E164(International Format) Format then COUNTRY_CODE will be considered as a country code of that Mobile Number.
FORMAT : Format of the output. 1 . JSON 2 . XML 3 . YAML 4 . TEXT 5 . HTML
INSTALLATION_ID : To know your InstallationId , install the package globally.
InstallationId
Examples
Here mobile number is in national format and country code is indian. So india is considered as a country code of that mobile number and response will be json format.
Here mobile number is in international format. So it is a US number.
Make a bulk search in your project.