What if your users could find nearby places without selecting categories, filling out filters, or knowing exactly what to search for?
Imagine someone opening your application and asking:
- "I'm hungry, find restaurants near me."
- "I'm in Paris, near the Eiffel Tower. Where can I get coffee?"
- "Where is the nearest pharmacy?"
- "Find parking around this location."
And your backend turns those questions into structured data containing real nearby places.
That's the idea behind askplaces, an open-source Node.js package I've been working on.
What is askplaces?
askplaces is a Node.js library that understands natural-language questions and converts them into structured place searches.
It uses an LLM to understand what the user wants, while OpenStreetMap provides the actual places, coordinates, road distances, and estimated travel times.
The result is structured JSON that you can easily integrate into your backend or application.
How does it work?
The workflow is simple:
- The user asks a question in plain language.
- An LLM understands the intent and extracts the place-search information.
- OpenStreetMap services find matching places and calculate routes.
- askplaces returns structured JSON.
Under the hood, it uses:
- LLM: Understands the user's question.
- Nominatim: Geocodes place names into coordinates.
- Overpass: Finds nearby places.
- Valhalla: Calculates walking, driving, and cycling routes and travel times.
One important detail: your LLM API key is only used to understand the question. It stays on your backend and is never exposed to the browser.
You don't need a Google Maps API key for the place data.
Getting started
First, install the package:
npm install askplaces
Requires Node.js 22 or newer.
A simple example
import { askPlaces } from "askplaces";
const result = await askPlaces(
"Find pharmacies near me",
{
provider: "openai",
apiKey: process.env.OPENAI_API_KEY,
origin: {
lat: 48.8584,
lng: 2.2945
}
}
);
if (result.answer) {
console.log(result.answer);
} else {
console.log(result.places);
}
That's it!
You can also use a different LLM provider by changing the provider option.
Supported LLM providers
Currently, askplaces supports:
- OpenAI
- Anthropic
- Google Gemini
- xAI
- DeepSeek
- Groq
You can also specify a different model using the optional model parameter.
What do you get back?
Each place can include:
- Name and category
- Address, phone number, and website when available
- Latitude and longitude
- Straight-line distance
- Road distance for walking, driving, and cycling
- Estimated travel time for each mode
The results are ordered by proximity.
No ratings or opening-hours information is provided. The focus is finding nearby places, not ranking businesses or determining whether they're currently open.
Where can you use it?
I built askplaces with different types of applications in mind:
- AI city assistants: Ask questions about nearby places.
- Travel applications: Help travelers discover restaurants, ATMs, pharmacies, and more.
- Local services: Find nearby clinics, suppliers, or service providers.
- Messaging bots: Build WhatsApp or Telegram location assistants.
- Delivery applications: Find nearby businesses and destinations.
- Neighborhood guides: Discover places around an address.
Basically, any backend that needs to turn a natural-language question into a nearby-place search could benefit from it.
A note about API keys and OpenStreetMap
The package is designed to run on your backend.
Your LLM API key should never be sent to the frontend. Your browser or mobile application should communicate with your backend instead.
OpenStreetMap provides the place and road data through its services. When displaying results, remember to include the required attribution:
© OpenStreetMap contributors
What's next?
This is an open-source project, and I'm looking forward to improving it based on real-world usage# I built askplaces: Find nearby places using natural language in Node.js 🌍
What if your users could find nearby places without selecting categories, filling out filters, or knowing exactly what to search for?
Imagine someone opening your application and asking:
- "I'm hungry, find restaurants near me."
- "I'm in Paris, near the Eiffel Tower. Where can I get coffee?"
- "Where is the nearest pharmacy?"
- "Find parking around this location."
And your backend turns those questions into structured data containing real nearby places.
That's the idea behind askplaces, an open-source Node.js package I've been working on.
What is askplaces?
askplaces is a Node.js library that understands natural-language questions and converts them into structured place searches.
It uses an LLM to understand what the user wants, while OpenStreetMap provides the actual places, coordinates, road distances, and estimated travel times.
The result is structured JSON that you can easily integrate into your backend or application.
How does it work?
The workflow is simple:
- The user asks a question in plain language.
- An LLM understands the intent and extracts the place-search information.
- OpenStreetMap services find matching places and calculate routes.
- askplaces returns structured JSON.
Under the hood, it uses:
- LLM: Understands the user's question.
- Nominatim: Geocodes place names into coordinates.
- Overpass: Finds nearby places.
- Valhalla: Calculates walking, driving, and cycling routes and travel times.
One important detail: your LLM API key is only used to understand the question. It stays on your backend and is never exposed to the browser.
You don't need a Google Maps API key for the place data.
Getting started
First, install the package:
npm install askplaces
Requires Node.js 22 or newer.
A simple example
import { askPlaces } from "askplaces";
const result = await askPlaces(
"Find pharmacies near me",
{
provider: "openai",
apiKey: process.env.OPENAI_API_KEY,
origin: {
lat: 48.8584,
lng: 2.2945
}
}
);
if (result.answer) {
console.log(result.answer);
} else {
console.log(result.places);
}
That's it!
You can also use a different LLM provider by changing the provider option.
Supported LLM providers
Currently, askplaces supports:
- OpenAI
- Anthropic
- Google Gemini
- xAI
- DeepSeek
- Groq
You can also specify a different model using the optional model parameter.
What do you get back?
Each place can include:
- Name and category
- Address, phone number, and website when available
- Latitude and longitude
- Straight-line distance
- Road distance for walking, driving, and cycling
- Estimated travel time for each mode
The results are ordered by proximity.
No ratings or opening-hours information is provided. The focus is finding nearby places, not ranking businesses or determining whether they're currently open.
Where can you use it?
I built askplaces with different types of applications in mind:
- AI city assistants: Ask questions about nearby places.
- Travel applications: Help travelers discover restaurants, ATMs, pharmacies, and more.
- Local services: Find nearby clinics, suppliers, or service providers.
- Messaging bots: Build WhatsApp or Telegram location assistants.
- Delivery applications: Find nearby businesses and destinations.
- Neighborhood guides: Discover places around an address.
Basically, any backend that needs to turn a natural-language question into a nearby-place search could benefit from it.
A note about API keys and OpenStreetMap
The package is designed to run on your backend.
Your LLM API key should never be sent to the frontend. Your browser or mobile application should communicate with your backend instead.
OpenStreetMap provides the place and road data through its services. When displaying results, remember to include the required attribution:
© OpenStreetMap contributors
What's next?
This is an open-source project, and I'm looking forward to improving it based on real-world usage and developer feedback.
I'd love to hear your thoughts:
- Would you use natural-language place search in your application?
- What features would you like to see?
- What kind of integrations or improvements would make it more useful?
Contributions, suggestions, and feedback are always welcome!
Try askplaces
📦 NPM: https://www.npmjs.com/package/askplaces
💻 GitHub: https://github.com/Med-Ri/ask-places
If you find it useful, feel free to give it a try, share your feedback, or contribute!
Thanks for reading! 🚀 and developer feedback.
I'd love to hear your thoughts:
- Would you use natural-language place search in your application?
- What features would you like to see?
- What kind of integrations or improvements would make it more useful?
Contributions, suggestions, and feedback are always welcome!
Try askplaces
📦 NPM: https://www.npmjs.com/package/askplaces
💻 GitHub: https://github.com/Med-Ri/ask-places
If you find it useful, feel free to give it a try, share your feedback, or contribute!
Thanks for reading! 🚀
Top comments (0)