sumithemmadi / truecallerjs

TruecallerJS: This is a library for retrieving phone number details using the Truecaller API.
http://truecaller.js.org/
MIT License
523 stars 109 forks source link

Unable to search phone number #97

Open sujoyg1982 opened 3 months ago

sujoyg1982 commented 3 months ago

I have been trying to follow the guide mentioned in the github project of truecallerjs node library and search a phone number without any success.

I have installed the npm package in my node environment that is running in an ubuntu machine. I have logged in using my phone number and otp well and got an installation Id too. But while doing search, I have been constantly getting 429 response code that said "ERR_BAD_REQUEST". Any idea why is this happening? Do I need to register my mobile number somewhere TC portal?

Below is the command and response sample.

truecallerjs -s +91 --json { "message": "Request failed with status code 429", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 429\n at settle (file:///usr/lib/node_modules/truecallerjs/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (file:///usr/lib/node_modules/truecallerjs/node_modules/axios/lib/adapters/http.js:589:11)\n at IncomingMessage.emit (node:events:530:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (file:///usr/lib/node_modules/truecallerjs/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async runCLI (file:///usr/lib/node_modules/truecallerjs/dist/cli.js:236:35)", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http", "fetch" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, /", "Content-Type": "application/json; charset=UTF-8", "accept-encoding": "gzip", "user-agent": "Truecaller/11.75.5 (Android;10)", "Authorization": "Bearer a1i08--nlqKNu-5-gztqiQ-NQMDWOIX3XE-lbsYjqub9H1n5bdcClRX9T7KFvmFp" }, "params": { "q": "", "countryCode": "IN", "type": 4, "locAddr": "", "placement": "SEARCHRESULTS,HISTORY,DETAILS", "encoding": "json" }, "method": "get", "url": "https://search5-noneu.truecaller.com/v2/search" }, "code": "ERR_BAD_REQUEST", "status": 429

gittyari commented 3 months ago

Same

gittyari commented 3 months ago

@sumithemmadi

BEST-COADER-ISHAAN commented 3 months ago

Same

priyankarpal commented 3 months ago

same issue

MaxBiz100 commented 3 months ago

same. I think true caller API dead....

slow-codex commented 3 months ago

For me the error code is different, message: Request failed with status code 401, this means unauthorized access. So I guess Truecaller must have moved this api's access to it's business category only, and not to open public usage. Error code 429 means Too many request, so I guess some dev might have pushed it to prod, later they changed it to 401 for Unauthorized. @sujoyg1982 would you try again to check the error code once.

fenizo commented 2 months ago

"message": "Request failed with status code 429", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 429\n at settle (file:///C:/Users/Home/AppData/Roaming/npm/node_modules/truecallerjs/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (file:///C:/Users/Home/AppData/Roaming/npm/node_modules/truecallerjs/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (file:///C:/Users/Home/AppData/Roaming/npm/node_modules/truecallerjs/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async runCLI (file:///C:/Users/Home/AppData/Roaming/npm/node_modules/truecallerjs/dist/cli.js:236:35)", i have face this issue any another options for looukup name