Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search not working #89

Open
piyushgarg opened this issue Apr 21, 2024 · 0 comments
Open

search not working #89

piyushgarg opened this issue Apr 21, 2024 · 0 comments

Comments

@piyushgarg
Copy link

var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'GET',
  'hostname': 'search5-noneu.truecaller.com',
  'path': '/v2/search?countryCode=IN&type=4&placement=SEARCHRESULTS,HISTORY,DETAILS&encoding=json&q=+91xxxxxxxxxx',
  'headers': {
    'Content-Type': 'application/json; charset=UTF-8',
    'User-Agent': 'Truecaller/14.1.6 (Android;14)',
    'Authorization': 'Bearer a2i9P--mK24dz-5-e-Mbhu0GFhbShT11wvf7ivkiGWI_t7uA3oAe1LYWD7ESinO8'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

req.end();

Response
{
"status": 42601,
"message": "Client must be upgraded"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant