Bulk Route Uploader – Route4Me’s Command-Line Automation Tool for Windows, macOS, and Linux

Route4Me’s Bulk Route Uploader is a command-line app that allows you to automate the process of optimizing routes with hundreds of thousands of addresses using the Terminal on your Windows, macOS, or Linux computer. To start using the Bulk Route Uploader, first, download the app to your computer and place it into the same folder with the following files:

  1. The Route4Me Bulk Route Uploader application file;
  2. Optimization files in the JSON file format;
  3. Route data file(s) (CSV spreadsheet(s) with addresses that you want to optimize).

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Optimization files (in the JSON file format) contain the optimization parameters that are applied to the route data file(s) (CSV spreadsheet(s) with addresses) that you want to optimize. To find more Route4Me JSON optimization code samples, visit this Route4Me GitHub page.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Route data spreadsheets must be in the CSV file format only. For a spreadsheet to be successfully optimized, it must contain a header row and data rows. The header row defines the type of information you are optimizing, while the corresponding data rows contain the actual data that is being optimized. To learn more about Route4Me’s spreadsheet requirements, visit this pageNOTE: In addition to the obligatory “Address” column, when using the Route4Me Bulk Route Uploader, the spreadsheet you want to optimize must also contain an obligatory column that groups all addresses in the spreadsheet into one or multiple routes. In the example below, the “Route” column groups all addresses with the same ID (“Los Angeles Route 0001”) into the same single route.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

To optimize a CSV route data file using the Route4Me Bulk Route Uploader, after placing all the necessary files into the same folder, open the Terminal on your Windows, macOS, or Linux computer and then insert the following snippet of code into the Terminal:

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

Parameter/ArgumentExample ValueDescription
-fRoute_0001.csvThe name of the CSV route data file you want to optimize.
-poptimize-existing-routes-8hrs.jsonThe name of the optimization (JSON) file that contains the optimization parameters.
-gRoute   The name of the grouping column in your CSV route data file.
-k11111111111111111111111111111111Your Route4Me API key

 

  1. The name of the directory/folder with the Bulk Route Uploader, optimization (JSON) file(s), and CSV route data file(s) that you want to optimize (path to the directory/folder);
  2. The name of the route data file with the addresses that you want to optimize;
  3. The name of the optimization (JSON) file that contains the optimization parameters that will be applied to the selected route data file;
  4. Your Route4Me account API key. When you are optimizing routes using the Route4Me Bulk Route Uploader, all optimized routes are automatically synchronized with the Route4Me account, the API key of which was inserted into the corresponding code.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

To find and copy your Route4Me API key, first, log into your Route4Me account, go to “My Account” from the navigation menu and then select “API” from the list (learn more). After that, you can copy your Route4Me API key accordingly.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

5. The grouping column from the CSV route data file which is used for grouping the addresses in the route data file into one or multiple routes. In the example below, the “Route” column groups all addresses with the same ID (“Los Angeles Route 0001”) into the same single route.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

After inserting the code with all the necessary arguments and values into the Terminal, hit enter/return to execute the code. After that, the Bulk Route Uploader will geocode all addresses in the corresponding CSV route data file and plan/optimize one or multiple routes (depending on the number of unique IDs in the grouping column) based on the parameters defined in the used optimization (JSON) file.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Once the CSV route data file is optimized, the Bulk Route Uploader will automatically create two folders in the parent folder of the Route4Me Bulk Route Uploader:

  1. The “Log” folder contains the log file(s) of the entire optimization process;
  2. The “Output” folder contains the file(s) with the optimized route(s).

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Once the route is optimized using the Route4Me Bulk Route Uploader, this route is automatically synchronized/uploaded into the Route4Me account, the API key of which was used for the optimization. To view and open the optimized route(s), log into your Route4Me account and then go to “Routes List” from the navigation menu.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

The planned and optimized route inherits the same name as the ID value that was used for grouping addresses for this route in the optimized CSV route data file.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

To plan multiple routes from a single route data file, you need to distribute all addresses in this route data file to different routes using unique IDs in the grouping column. To do so, in the grouping column, define a unique ID for each address, where the addresses with the same ID will go to the same route. In the example below, all addresses with the ID “Route 0001” will be added to the same single route. In the example below, there are 4 different address IDs defined in the grouping column, meaning that 4 routes will be created from this spreadsheet and the addresses with the same IDs will go to the same routes.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Once the routes are optimized using the Bulk Route Uploader, these routes are automatically synchronized/uploaded to the Route4Me account, the API key of which was used for the optimization. Each planned and optimized route inherits the same name as the ID value that was used for grouping addresses for this route in the optimized route data file.

Bulk Route Uploader - Route4Me's Command-Line Automation Tool for Windows, macOS, and Linux

 

Visit Route4Me's Marketplace to Check Out Various Industry-Specific Subscription Plans:

Was this article helpful?
Still can't find what you're looking for? Contact us