/truecallerpy

A python module to search phone number details

Primary LanguagePythonMIT LicenseMIT

PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - License

A package to search phone number details.

Requirements

Installation

Install this pip package

pip install truecallerpy

Login

Then login to your truecaller account .

~$ truecallerpy --login

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

If you still facing problems in login then try below steps.

  1. On Truecaller Android, tap on the 3 line menu on top left
  2. Tap on Privacy Center and then click on Download my data.
  3. Now a json file is downloaded.
  4. Save the json file on your PC at any location e.g /home/HP/1234567890-99123456789.json
  5. On you terminal or command prompt enter below command.
~$ truecallerpy --login -f /home/HP/1234567890-99123456789.json
  1. Now you are successfully logged in.

InstallationId

Enter the below command to see your InstallationId.

~$ truecallerpy --installationid

Print only installation Id.

~$ truecallerpy -i -r

Searching a number

~$ truecallerpy -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@gmail.com",
               "service": "email",
               "caption": "Sumith Emmadi",
               "type": "internetAddress"
            }
         ],
         "badges": [
            "verified",
            "user"
         ],
         "cacheTtl": "",
         "sources": [],
         "searchWarnings": [],
         "surveys": []
      }
   ],
   "provider": "ss-nu",
   "stats": {
      "sourceStats": []
   }
}

To get raw output.

~$ truecallerpy -s [number] -r
{"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@gmail.com","service":"email","caption":"Sumith Emmadi","type":"internetAddress"}],"badges":["verified","user"],"cacheTtl":"","sources":[],"searchWarnings":[],"surveys":[]}],"provider":"ss-nu","stats":{"sourceStats":[]}}

To print only name.

~$ truecallerpy -s [number] --name
Name : Sumith Emmadi

Other command's

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

Sumith Emmadi

To print only email.

~$ truecallerpy -s [number] --email
Email : username@email.com

Other command's

~$ truecallerpy -s [number] --email -r 

username@email.com

To get only JSON output

~$ truecallerpy -s [number] --json
~$ truecallerpy -s [number] -r --json
{"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@gmail.com","service":"email","caption":"Sumith Emmadi","type":"internetAddress"}],"badges":["verified","user"],"cacheTtl":"","sources":[],"searchWarnings":[],"surveys":[]}],"provider":"ss-nu","stats":{"sourceStats":[]}}

Usage

from truecallerpy import search_phonenumber

id = "Your installationId at here"
# To know your installation id run `truecallerpy -i` on terminal or command prompt

# search_phonenumber( "PHONE_NUMBER","COUNTRY_CODE","INSTALLATION_ID")

search_phonenumber("9912345678","IN", id)

# ==> search_phonenumber("+12093031250","IN", id)
  • 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.
  • INSTALLATION_ID : To know your InstallationId , install the package globally.

License

MIT License

Copyright (c) 2022 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.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.