{"id":22528708,"url":"https://github.com/mapup/tollguru-api-parameter-examples","last_synced_at":"2025-03-28T04:41:38.656Z","repository":{"id":213537190,"uuid":"734336200","full_name":"mapup/tollguru-api-parameter-examples","owner":"mapup","description":"This repo lists request parameters and corresponding JSON to use with the TollGuru Toll API to receive specific responses.","archived":false,"fork":false,"pushed_at":"2024-08-14T18:55:55.000Z","size":679,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-02T05:41:17.887Z","etag":null,"topics":["fuel-calculator-service","gps-tracking","route-optimization","toll-api","toll-calculator","tollguru","trip-planner"],"latest_commit_sha":null,"homepage":"https://tollguru.com/toll-api-docs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-21T12:34:41.000Z","updated_at":"2024-08-14T18:55:59.000Z","dependencies_parsed_at":"2023-12-26T05:26:16.282Z","dependency_job_id":"80649e33-1878-4ed2-b83c-45e3bd48c36a","html_url":"https://github.com/mapup/tollguru-api-parameter-examples","commit_stats":null,"previous_names":["mapup/tollguru-api-parameter-use-cases","mapup/tollguru-api-parameter-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapup%2Ftollguru-api-parameter-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapup%2Ftollguru-api-parameter-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapup%2Ftollguru-api-parameter-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapup%2Ftollguru-api-parameter-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapup","download_url":"https://codeload.github.com/mapup/tollguru-api-parameter-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245972634,"owners_count":20702711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuel-calculator-service","gps-tracking","route-optimization","toll-api","toll-calculator","tollguru","trip-planner"],"created_at":"2024-12-07T07:12:04.138Z","updated_at":"2025-03-28T04:41:38.632Z","avatar_url":"https://github.com/mapup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TollGuru API Parameter Examples\r\n\r\nThis repository provides examples of how to interact with the TollGuru API. The TollGuru API offers a comprehensive suite of tools for calculating toll costs for various routes and vehicles, providing accurate and efficient toll pricing information. This guide will help you understand how to use the provided examples to integrate toll calculations into your applications.\r\n\r\n## Table of Contents\r\n\r\n- [Project Description](#project-description)\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Features](#features)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n- [Contact](#contact)\r\n- [Additional Resources](#additional-resources)\r\n\r\n## Project Description\r\n\r\nThe TollGuru API allows developers to calculate toll costs for different routes based on vehicle parameters and toll policies. This API is useful for various applications, including fleet management, trip planning, and logistics. With support for different vehicle types and configurations, the API provides flexible and accurate toll calculation.\r\n\r\nKey features include:\r\n- **Route Calculation**: Determine toll costs for specified routes.\r\n- **Vehicle Parameterization**: Customize calculations based on vehicle type, fuel cost, tag cost, and more.\r\n- **Multi-Route Support**: Compare toll costs for multiple routes to find the most cost-effective path.\r\n\r\nFor a comprehensive overview of the TollGuru API, please visit the [TollGuru API Documentation](https://www.tollguru.com/toll-api-docs).\r\n\r\n## Installation\r\n\r\nTo use the examples in this repository, clone the repo to your local machine and install the necessary dependencies.\r\n\r\n```bash\r\ngit clone https://github.com/mapup/tollguru-api-parameter-examples.git\r\ncd tollguru-api-parameter-examples\r\nnpm install\r\n```\r\n\r\n## Usage\r\n\r\nThe repository includes several example scripts that demonstrate how to interact with the TollGuru API. Each example showcases different functionalities of the API.\r\n\r\n### Example: Calculate Toll Costs\r\n\r\n```javascript\r\nconst axios = require('axios');\r\n\r\nconst calculateToll = async () =\u003e {\r\n  const response = await axios.post('https://api.tollguru.com/v1/calc/route', {\r\n    source: {\r\n      lat: 37.7749,\r\n      lng: -122.4194\r\n    },\r\n    destination: {\r\n      lat: 34.0522,\r\n      lng: -118.2437\r\n    },\r\n    vehicleType: \"2AxlesAuto\",\r\n    departure_time: \"2023-08-01T12:00:00Z\"\r\n  }, {\r\n    headers: {\r\n      'Content-Type': 'application/json',\r\n      'x-api-key': 'YOUR_API_KEY'\r\n    }\r\n  });\r\n\r\n  console.log(response.data);\r\n};\r\n\r\ncalculateToll();\r\n```\r\n\r\nReplace `'YOUR_API_KEY'` with your actual API key. This example demonstrates how to calculate toll costs for a route between San Francisco and Los Angeles for a 2-axle automobile.\r\n\r\n### Example: Vehicle Parameters\r\n\r\n```javascript\r\nconst axios = require('axios');\r\n\r\nconst getVehicleParameters = async () =\u003e {\r\n  const response = await axios.get('https://api.tollguru.com/v1/vehicle-types', {\r\n    headers: {\r\n      'Content-Type': 'application/json',\r\n      'x-api-key': 'YOUR_API_KEY'\r\n    }\r\n  });\r\n\r\n  console.log(response.data);\r\n};\r\n\r\ngetVehicleParameters();\r\n```\r\n\r\n### Example: Route Preferences\r\n\r\n```javascript\r\nconst axios = require('axios');\r\n\r\nconst calculatePreferredRoute = async () =\u003e {\r\n  const response = await axios.post('https://api.tollguru.com/v1/calc/route', {\r\n    source: {\r\n      lat: 40.7128,\r\n      lng: -74.0060\r\n    },\r\n    destination: {\r\n      lat: 34.0522,\r\n      lng: -118.2437\r\n    },\r\n    vehicleType: \"2AxlesAuto\",\r\n    departure_time: \"2023-08-01T12:00:00Z\",\r\n    preferred_routes: [\"fastest\", \"shortest\"]\r\n  }, {\r\n    headers: {\r\n      'Content-Type': 'application/json',\r\n      'x-api-key': 'YOUR_API_KEY'\r\n    }\r\n  });\r\n\r\n  console.log(response.data);\r\n};\r\n\r\ncalculatePreferredRoute();\r\n```\r\n## Contributing\r\n\r\nWe welcome contributions to this repository! If you have suggestions or improvements, please open an issue or submit a pull request.\r\n\r\n1. Fork the repository.\r\n2. Create a new branch (`git checkout -b feature-branch`).\r\n3. Make your changes.\r\n4. Commit your changes (`git commit -m 'Add new feature'`).\r\n5. Push to the branch (`git push origin feature-branch`).\r\n6. Open a pull request.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\r\n\r\n## Contact\r\n\r\nFor any questions or support, please reach out to [api-support@tollguru.com](mailto:api-support@tollguru.com).\r\n\r\n## Additional Resources\r\n\r\nFor a comprehensive overview and additional details, refer to the following sections of the [TollGuru API Documentation](https://www.tollguru.com/toll-api-docs):\r\n\r\n- [API Overview](https://www.tollguru.com/toll-api-docs#api-overview)\r\n- [Authentication](https://www.tollguru.com/toll-api-docs#authentication)\r\n- [Endpoints and Parameters](https://www.tollguru.com/toll-api-docs#endpoints-and-parameters)\r\n  - [Calculate Toll Costs between start, to, waypoints](https://www.tollguru.com/toll-api-docs#tolls-between-origin-destination-and-waypoints)\r\n  - [Calculate Toll Costs for an encoded polyline](https://www.tollguru.com/toll-api-docs#route-encoded-polyline)\r\n  - [Calculate Toll Costs from a GPS track](https://www.tollguru.com/toll-api-docs#tolltally---gps-tracks-to-toll-api)\r\n  - [Vehicle Types](https://www.tollguru.com/toll-api-docs#vehicle-types-supported-by-tollguru)\r\n- [Error Handling](https://www.tollguru.com/toll-api-docs#errors-and-troubleshooting)\r\n- [FAQ](https://www.tollguru.com/toll-api-docs#faq)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapup%2Ftollguru-api-parameter-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapup%2Ftollguru-api-parameter-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapup%2Ftollguru-api-parameter-examples/lists"}