Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
google place autocomplete on server side with google-maps-services-js

I am trying to use place autocomplete on server side with google-maps-services-js. And want to restrict to specific country. For example want to get results only in France. But i cant get the result that i wanted. What am i doing wrong. Here is my code:

const {Client} = require("@googlemaps/google-maps-services-js");

export default async function handler(req, res) {
  const client = new Client({});

  client
  .placeQueryAutocomplete({
    params: {
      locations: [{ lat: 35.6667, lng: 39.1667}],
      key: GOOGLE_MAP_API_KEY,
       input: "par",
      language: "en",
      components:[{'country': "fr"}]
    },
    timeout: 1000 // milliseconds
  })
  .then(r => {
    res.json(r.data);
  })
  .catch(e => {
    res.json(e);
  });
}

Thanks for the help!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!