Table of Contents

Distance

Distance RadiusDistance MatrixDistance Calculation ModesDistance Overview

Distance Radius

Distance Radius: Filtering and Sorting Results

Geocodio's Distance API includes built-in parameters to filter and sort results. These features allow you to create a distance radius or only find results that meet certain distance criteria.

Radius features are available for both straightline and driving distance.

These parameters work with all three distance endpoints (Distance, Distance Matrix, and Distance Jobs).

Example use cases

  • Find warehouses that are within a 50 mile driving radius of a customer's location
  • Find sales people who are within a 30-minute driving radius of a prospect
  • Determine which potential store locations that are at least 10 miles from current locations

Filter by distance

  • max_distance: Only return destinations within this distance (in miles or kilometers)
  • min_distance: Exclude destinations closer than this distance

Example: To find locations within 25 miles, set max_distance=25.

Filter by travel time

These parameters work only with driving mode:

  • max_duration: Only return destinations reachable within this time (in seconds)
  • min_duration: Exclude destinations reachable in less than this time

Example: To find locations within a 30-minute drive, set max_duration=1800.

Limit results

  • max_results: Return only the nearest N destinations

Example: To get only the 5 closest locations, set max_results=5.

Sort results

  • order_by: Sort by distance or duration
  • sort_order: asc (ascending/nearest first) or desc (descending/farthest first)

Combining parameters

You can combine duration, distance, limiting, and sorting parameters. For example, to find the 3 closest clinics within a 30-minute drive:

  • mode=driving
  • max_duration=1800
  • max_results=3
  • order_by=duration
  • sort_order=asc

Documentation

See more about creating radiuses and filtering and sorting distance results in Geocodio's Distance API documentation.

Copyright © 2014-2026 Dotsquare LLC, Norfolk, Virginia. All rights reserved.