autocomplete
ClaudeComplete a partial address or administrative-area prefix into full valid addresses (e.g. "stat" -> "State Capitol, ..."). Use for prefix completion as the user types; use autosuggest for typo-tolerant fuzzy suggestions and geocode_forward for a full address. Parameters: query (required); optional near {latitude, longitude}, radius_m (with near), country_codes, bounding_box {west, south, east, north}, limit, language, view. Example: {"query": "stat", "near": {"latitude": 35.4769, "longitude": -97.4872}, "limit": 5}
autosuggest
ClaudeSuggest address and place candidates from an incomplete or misspelled query (typo-tolerant, e.g. "aqaurium" still matches aquariums). Use for search-as-you-type; use autocomplete for strict prefix completion of valid addresses. Parameters: query (required); optional near {latitude, longitude}, radius_m (with near), country_codes, bounding_box {west, south, east, north}, limit, language, view. Example: {"query": "aqauriums", "near": {"latitude": 42.3501, "longitude": -71.0689}, "limit": 5}
bbox
ClaudeThe smallest latitude/longitude box around a set of points, a line or a polygon, optionally padded in metres — for example a viewport for static_map_image or a spatial filter. Handles shapes that straddle the antimeridian (reports crosses_antimeridian and the narrower box). Computed locally, no sign-in needed. Parameters: exactly one of points (array of {latitude, longitude}), line (array of points) or polygon (GeoJSON Polygon/MultiPolygon, isochrone Feature accepted); padding_meters (default 0). Returns min_latitude, min_longitude, max_latitude, max_longitude, crosses_antimeridian. Example: {"points": [{"latitude": 12.9716, "longitude": 77.5946}, {"latitude": 13.0827, "longitude": 80.2707}], "padding_meters": 500}
buffer
ClaudeBuild the zone within a given straight-line distance of a point (a circle), a line (a corridor, e.g. 1 km along a route) or a polygon (grown outward, or shrunk inward with a negative distance). Geodesic on WGS84, computed locally, no sign-in needed. Returns a GeoJSON Polygon or MultiPolygon (a shrunk shape may split) with its area; an empty result is returned, not an error. Parameters: exactly one of point ({latitude, longitude}), line (array of points) or polygon (GeoJSON Polygon/MultiPolygon, isochrone Feature accepted); distance (number, negative only for polygon); units (default meters); steps (points per circle, default 16); area_units; max_vertices (default 500). Example: {"line": [{"latitude": 12.9716, "longitude": 77.5946}, {"latitude": 12.99, "longitude": 77.62}], "distance": 1, "units": "kilometers"}
centroid
ClaudeThe area-weighted centre of a polygon and a label point that is guaranteed to lie inside it (the centroid of a C- or ring-shaped area falls outside; the label point does not). Computed locally, no sign-in needed. Parameters: polygon (GeoJSON Polygon/MultiPolygon, or an isochrone Feature). Returns centroid, label_point ({latitude, longitude}) and centroid_inside. Example: {"polygon": {"type": "Polygon", "coordinates": [[[77.59, 12.97], [77.61, 12.97], [77.61, 12.99], [77.59, 12.99], [77.59, 12.97]]]}}
directions
ClaudeCalculate a route between an origin and a destination with optional waypoints; returns distance (meters), duration (seconds) and an encoded polyline per route, which static_route_map can draw. Use distance_matrix for many pairs. Documentation for this API is available through search_documentation. Parameters: origin, destination {latitude, longitude} (required); optional waypoints (max 200), mode (car | truck | motorcycle | bike | walk), service ("flexible" default: all options; "fast": car/truck only, lower latency), route_type, departure_time, avoid (soft), exclude (strict), road_info, honor_restrictions, alternatives, steps (fast only), geometry (polyline | polyline6), cross_border; truck options: truck_size_cm, truck_weight_kg, truck_axle_load, hazmat_type, emission_class; freight network: prefer "truck_route" + truck_type (rigid_truck | semi_trailer | b_double | road_train | generic_truck) for roads legal for that truck class, require "truck_route" to stay on it. Example: {"origin": {"latitude": 37.7749, "longitude": -122.4194}, "destination": {"latitude": 34.0522, "longitude": -118.2437}, "mode": "truck", "prefer": "truck_route", "truck_type": ["b_double"]}
distance_matrix
ClaudeCompute travel distance (meters) and duration (seconds) for every origin-to-destination pair in one call; one row per origin with one element per destination, in input order. Use it instead of repeated directions calls when several pairs are needed. Documentation for this API is available through search_documentation. Parameters: origins, destinations (arrays of {latitude, longitude}, required); optional mode, service ("fast" default: up to 1000x1000 points; "flexible": the options below, max 50x50), route_type, departure_time, avoid (soft), exclude (strict), honor_restrictions, route_failed_prompt (unroutable pairs return -1 instead of 0), truck options: truck_size_cm {height, width, length}, truck_weight_kg, truck_axle_load, hazmat_type, emission_class, cross_border, prefer "truck_route" + truck_type (roads legal for a truck class on the designated freight network). Example: {"origins": [{"latitude": 1.29, "longitude": 103.85}], "destinations": [{"latitude": 1.35, "longitude": 103.99}, {"latitude": 1.3, "longitude": 103.77}], "route_failed_prompt": true}
geocode_batch
ClaudeForward-geocode up to 100 free-text queries in one request; returns one ranked result set per query, in input order. Use it instead of repeated geocode_forward calls when several addresses are needed: this endpoint has its own rate limit of 60 requests per minute, so larger batches per call stay within it. Parameters: queries (required array; each item: query (required), optional near {latitude, longitude}, radius_m, country_codes, bounding_box, limit, language, view, types); optional top-level types (houseNumber | addressBlock | street | intersection | place | area) as the default for all queries (a per-query types overrides it). Example: {"queries": [{"query": "600-699 Golden Gate Ave, San Francisco, CA", "types": ["addressBlock"]}, {"query": "Empire State Building", "country_codes": ["USA"]}]}
geocode_forward
ClaudeConvert a free-text address, place name, locality or administrative area into coordinates and a full postal address; tolerates incomplete or partly wrong input. Use geocode_batch for many addresses, place_search for POIs/businesses, geocode_structured when the address components are already separated. Parameters: query (required); optional near {latitude, longitude} or country_codes (strongly recommended - landmark names rank poorly without a location bias), radius_m (with near), bounding_box {west, south, east, north}, limit, language, view, types (houseNumber | addressBlock | street | intersection | place | area). Example: {"query": "1600 Pennsylvania Avenue NW, Washington DC", "country_codes": ["USA"], "limit": 1}
geocode_reverse
ClaudeFind the nearest address for a coordinate; returns the full postal address, the matched position and a bounding box. Parameters: coordinate {latitude, longitude} (required); optional country_codes, bounding_box {west, south, east, north}, language, view. Example: {"coordinate": {"latitude": 48.8566, "longitude": 2.3522}}
geocode_structured
ClaudeGeocode an address given as separate fields instead of one string; searches addresses and administrative areas only, never POIs. Use when the components are already known and precision matters; otherwise use geocode_forward. Parameters: country_code (required, ISO 3166-1 alpha-3) plus at least one of state, county, city, suburb, neighborhood, street, house_number, postal_code; optional near {latitude, longitude}, limit, types, view. Example: {"country_code": "GBR", "city": "London", "street": "Baker Street", "house_number": "221B"}
get_api_parameters
ClaudeGet structured parameter details for a NextBillion REST API endpoint: type, required, default, allowed values, units and description. More precise than a prose search for questions about one specific parameter. Returns every matching API variant (e.g. directions/flexible and directions/fast), identified by heading_path. Empty units means the documentation does not state a unit. SDK methods are not covered. When the index is temporarily unavailable the result says so and names the public docs site. Parameters: - endpoint (string, required unless doc_id given): API slug, optionally with variant, e.g. directions or directions/flexible; a tool name such as geocode_batch or a doc_id also resolves. An unknown endpoint returns found: false with similar endpoints. - doc_id (string, optional): page id instead of endpoint. - name (string, optional): one parameter name. Example: {"endpoint": "directions", "name": "truck_weight"}
get_documentation
ClaudeFetch the full text of one documentation page by its doc_id, as returned by search_documentation. Use when an excerpt is not enough to answer accurately. Pages over the size limit return truncated: true and a section list; a single section can be requested with section. Sample request and response bodies are omitted unless include_examples is true. An unknown doc_id or section returns found: false with similar ids or the section list. When the index is temporarily unavailable the result says so and names the public docs site. Parameters: - doc_id (string, required): page id from search results. - section (string, optional): heading of one section to return. - include_examples (boolean, optional): default false. Example: {"doc_id": "routing/directions-api/examples/legal-routes-for-a-given-truck-weight"}
isochrone
ClaudeCalculate the area reachable from a point within given travel times or distances; returns a GeoJSON FeatureCollection of contours (geometry coordinates are [longitude, latitude]). Each contour ring can be drawn with static_route_map by passing it as paths[].geojson_coordinates with a fill_color. Documentation for this API is available through search_documentation. Parameters: origin {latitude, longitude} (required); exactly one of contours_minutes (array, up to 4 values, max 40) or contours_meters (array, up to 4 values, max 60000); optional mode, polygons (true for Polygon geometry), denoise, generalize (meters), contours_colors (hex without #, one per contour), departure_time. Example: {"origin": {"latitude": 37.7749, "longitude": -122.4194}, "contours_minutes": [5, 10], "polygons": true}
list_documentation_topics
ClaudeList the available documentation categories, APIs and pages, with index metadata. Useful before searching, when the right terms are not yet known, e.g. to see which APIs exist for a problem area. When the index is temporarily unavailable the result says so and names the public docs site. Parameters: - category (string, optional): limit to one category. - sdk (string, optional): Android, iOS or Flutter. Example: {"category": "Optimization"}
measure
ClaudeMeasure straight-line (geodesic, WGS84) distance between two points, the length of a line, the area and perimeter of a polygon, or the bearing from one point to another. Straight-line (geodesic) geometry computed locally, not road distance or travel time: for those, directions or distance_matrix apply. No sign-in needed. Parameters: mode (distance | length | area | bearing); from and to ({latitude, longitude}) for distance and bearing; line (array of points) for length; polygon (GeoJSON Polygon or MultiPolygon, e.g. an isochrone contour) for area; units (meters, kilometers, miles, feet, nautical_miles; default meters); area_units (square_meters, square_kilometers, hectares, acres, square_miles, square_feet; default square_meters). Example: {"mode": "distance", "from": {"latitude": 12.9716, "longitude": 77.5946}, "to": {"latitude": 13.0827, "longitude": 80.2707}, "units": "kilometers"}
nearest
ClaudeFind the candidate points nearest to a target as the crow flies (e.g. the closest depots to a customer), or snap the target onto a line and report the closest position on it. Straight-line (geodesic) distances, computed locally, no sign-in needed; distance_matrix gives travel time and road distance instead. Parameters: target ({latitude, longitude}); either candidates (array of {latitude, longitude, id?}) with k (default 1), or line (array of points); units (default meters). Returns ranked {id, point, distance} for candidates, or snapped_point, distance, segment_index and distance_along_line for a line. Example: {"target": {"latitude": 12.9716, "longitude": 77.5946}, "candidates": [{"latitude": 13.0827, "longitude": 80.2707, "id": "Chennai"}, {"latitude": 19.076, "longitude": 72.8777, "id": "Mumbai"}], "k": 1, "units": "kilometers"}
place_browse
ClaudeList places of given categories around a location, ranked by distance, without a text query - e.g. all restaurants or schools near a point. Use place_search when the user describes what they want in words; use place_lookup to expand a result by id. Parameters: categories (required array of category names or ids); near {latitude, longitude} (recommended), radius_m (with near), country_codes, bounding_box {west, south, east, north}, limit, language, view. Example: {"categories": ["restaurant"], "near": {"latitude": 1.2839, "longitude": 103.8607}, "radius_m": 800, "limit": 10}
place_lookup
ClaudeFetch the full details of a place (address, position, access points, categories, contacts) by its unique id, as returned by place_search, geocode_forward, autosuggest, autocomplete or search_along_route. Parameters: id (required); optional view. Example: {"id": "2EmBgAmFpR9dg0D89EBzNA"}
place_search
ClaudeSearch for places, points of interest and businesses with a free-text query (e.g. "gas station", "coffee"), ranked by relevance around a location. Use geocode_forward for plain address-to-coordinates conversion. Documentation for this API is available through search_documentation. Parameters: query (required); optional near {latitude, longitude} (recommended), radius_m (with near), country_codes, bounding_box {west, south, east, north}, limit, language, view. Example: {"query": "coffee", "near": {"latitude": 37.7749, "longitude": -122.4194}, "radius_m": 1000, "limit": 5}
points_in_polygon
ClaudeGeofencing: tell which of up to 1,000 points lie inside a polygon, for example which delivery addresses fall within an isochrone contour or a service area. Holes are respected; the test is done in map (flat degree) space, matching how polygons are drawn. Computed locally, no sign-in needed. Parameters: polygon (GeoJSON Polygon or MultiPolygon, or an isochrone Feature); points (array of {latitude, longitude, id?}); include_boundary (default true). Returns inside and outside lists (ids, or indexes when no id is given) with counts. Example: {"polygon": {"type": "Polygon", "coordinates": [[[77.59, 12.97], [77.61, 12.97], [77.61, 12.99], [77.59, 12.99], [77.59, 12.97]]]}, "points": [{"latitude": 12.98, "longitude": 77.6, "id": "A"}]}
polygon_ops
ClaudeCombine polygons: union (merge), intersect (overlap) or difference (first minus the others), for example the overlap of two isochrones or the part of a zone not covered by a depot area. Returns the resulting GeoJSON geometry (Polygon or MultiPolygon, or null when empty) with its geodesic area. Computed locally, no sign-in needed. Parameters: operation (union | intersect | difference); polygons (array of 2–20 GeoJSON Polygon/MultiPolygon geometries, isochrone Features accepted); area_units (default square_meters); max_vertices (default 500, result simplified to fit). Example: {"operation": "intersect", "polygons": [{"type": "Polygon", "coordinates": [[[77.59, 12.97], [77.61, 12.97], [77.61, 12.99], [77.59, 12.99], [77.59, 12.97]]]}, {"type": "Polygon", "coordinates": [[[77.6, 12.98], [77.62, 12.98], [77.62, 13.0], [77.6, 13.0], [77.6, 12.98]]]}], "area_units": "hectares"}
postcode_lookup
ClaudeGet the centroid and boundary polygon of a postal/ZIP code, or find the postal code that contains a coordinate; one lookup per call. Supported countries: USA, India, UK, Netherlands, Austria, Germany, Indonesia, France, Singapore, Philippines, Canada, Australia, New Zealand, Italy, Brazil, Mexico, Spain. Parameters: either postal_code plus country (name, alpha-2 or alpha-3 code), or coordinate {latitude, longitude}; optional geojson_boundary (true for a GeoJSON boundary). Example: {"postal_code": "90011", "country": "USA"}
search_along_route
ClaudeFind places matching a text query along a driving route, with the detour time and distance each stop adds - for "find X on the way" questions. Pass the route as an ordered list of waypoints, e.g. the origin, waypoints and destination used with directions. Parameters: route_points (array of {latitude, longitude}, at least 2, required), query (required); optional max_detour_seconds (default 900, max 3600), sort_by (detour_time | detour_offset), limit (max 20), view. Example: {"route_points": [{"latitude": 34.0493, "longitude": -118.2557}, {"latitude": 34.0415, "longitude": -118.231}], "query": "gas station", "max_detour_seconds": 600}
search_documentation
ClaudeSearch NextBillion's official API and SDK documentation. Use for any question about how NextBillion works: calling an API, what a parameter means, which API to use, or SDK setup. Answers come from an index of the official documentation, not from live API calls; when the index is temporarily unavailable the result says so and names the public docs site. Queries match best with the docs' own terms and exact parameter names (truck_weight, option=flexible) rather than everyday phrasing; when results are thin, other API terms may match. Results are excerpts: get_documentation returns a full page. Each result carries a source_url for citation and related_tools, the name of the tool that performs the operation. Parameters: - query (string, required): search terms. - category (string, optional): e.g. Routing, Places. - api (string, optional): e.g. Directions. - sdk (string, optional): Android, iOS or Flutter. - limit (integer, optional): default 5, max 10. - include_examples (boolean, optional): default false. Example: {"query": "truck_size truck_weight routing", "api": "Directions"}
static_map_image
ClaudeRender a static map image centered on a location, with optional markers and line/polygon overlays; returns the image inline (path in the result text). For a map auto-fitted to a route or to overlays, use static_route_map. Parameters: center {latitude, longitude} and zoom (0-22) (required); optional markers (array of {latitude, longitude, color, icon_url, anchor, scale}), paths (array of {points [{latitude, longitude}] OR geojson_coordinates [[longitude, latitude], ...], stroke_color, stroke_width, fill_color for a filled polygon}), width, height (default 512), style (streets | light | dark | hybrid), format (png | jpg | webp), retina. Example: {"center": {"latitude": 48.8566, "longitude": 2.3522}, "zoom": 14, "markers": [{"latitude": 48.8584, "longitude": 2.2945, "color": "red"}], "paths": [{"points": [{"latitude": 48.85, "longitude": 2.29}, {"latitude": 48.86, "longitude": 2.30}], "stroke_color": "green"}]}
static_route_map
ClaudeRender a static map auto-fitted to a route and/or overlays: a route from directions, and/or lines and filled polygons such as isochrone contours; very long geometry is simplified automatically to fit the map API URL limit (distances unaffected). Returns the image inline. Parameters: at least one of encoded_polyline (the geometry string from directions, preferred), route_points (array of {latitude, longitude}) or paths (array of {points OR geojson_coordinates [[longitude, latitude], ...], stroke_color, stroke_width, fill_color}); optional markers (array of {latitude, longitude, color, icon_url, anchor, scale}), stroke_color, stroke_width (route line), padding, width, height, style, format, retina. The example draws isochrone contours. Example: {"paths": [{"geojson_coordinates": [[-122.42, 37.77], [-122.40, 37.78], [-122.41, 37.79], [-122.42, 37.77]], "fill_color": "rgba(29,78,216,0.35)", "stroke_color": "#1d4ed8"}], "markers": [{"latitude": 37.7749, "longitude": -122.4194, "color": "red"}]}