Table of contents
  1. GeoScraper API Documentation - Google Map Direction API
    1. Google Map Direction API
      1. Endpoint
      2. Headers
      3. Request Body
      4. Sample Request
      5. Sample Response
      6. Description

GeoScraper API Documentation - Google Map Direction API

Google Map Direction API

This endpoint is designed to provide directions from Google Maps between two specified locations.

Endpoint

  • POST: https://api.geoscraper.net/google/map/direction

Headers

  • X-Berserker-Token: Your_Access_Token

Request Body

  • Format: JSON
  • Fields:
    • start_dataId (required): The unique identifier for the starting location.
    • end_dataId (required): The unique identifier for the destination location.
    • mode (optional): Mode of transportation (e.g., driving, walking, etc.).
    • hl (optional): Language parameter to specify the response language.
    • catched (optional): Boolean to indicate if cached data should be used.

Sample Request

import requests

url = "https://api.geoscraper.net/google/map/direction"
payload = {
    "start_dataId": "0x8644b13b8b4aff45:0x1ca7fca8c9dc2768",
    "end_dataId": "0x8644ca4259a4bacf:0x5782c78a0ae2d9a3",
    "mode": 1,
    "hl": "en",
    "catched": true
}
headers = {'X-Berserker-Token': 'Your_Access_Token'}

response = requests.post(url, headers=headers, json=payload)
print(response.text)

Sample Response

{
  "Start_Places": {
    "title": "Austin-Bergstrom International Airport",
    "place_id": "ChIJRf9KizuxRIYRaCfcyaj8pxw",
    "data_id": "0x8644b13b8b4aff45:0x1ca7fca8c9dc2768",
    "data_cid": 2064896756044015400,
    "gps_coordinates": {
      "latitude": 30.1953204,
      "longitude": -97.6667054
    },
    "provider_id": "/m/01mz2x",
    "rating": 4.2,
    "reviews": 13018,
    "type": "Airport",
    "types": [
      "Airport"
    ],
    "address": "3600 Presidential Blvd, Austin, TX 78719, United States",
    "operating_hours": {},
    "phone": "+1 512-530-2242",
    "website": "https://www.austintexas.gov/airport",
    "description": {
      "description one": "Central Texas hub with live music",
      "description two": "Austin-area airport featuring regular live-music performances & numerous artworks."
    },
    "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipPKWNxFbj0xJ2AyUEGShqZMxaZvwJTTa6ORk8iD=w211-h120-k-no-pi-0-ya24.999996-ro-0-fo100"
  },
  "End_Places": {
    "title": "5540 N Lamar Blvd",
    "place_id": "ChIJz7qkWULKRIYRo9niCorHglc",
    "data_id": "0x8644ca4259a4bacf:0x5782c78a0ae2d9a3",
    "data_cid": 6305821823974169000,
    "gps_coordinates": {
      "latitude": 30.3246388,
      "longitude": -97.7278869
    },
    "provider_id": "/g/11b8v6z4p0",
    "type": "Building",
    "types": [
      "Building"
    ],
    "address": "5540 N Lamar Blvd, Austin, TX 78756",
    "operating_hours": {},
    "description": {},
    "thumbnail": "https://streetviewpixels-pa.googleapis.com/v1/thumbnail?panoid=QeXJAoExIYJXW96-zWad6w&cb_client=search.gws-prod.gps&w=360&h=120&yaw=292.61862&pitch=0&thumbfov=100"
  },
  "Direction": [
    {
      "Travel_mode": "Driving",
      "Direction": "183 Toll",
      "Time": "16 min",
      "Distance": "13.0 miles"
    },
    {
      "Travel_mode": "Driving",
      "Direction": "Airport Blvd",
      "Time": "22 min",
      "Distance": "9.9 miles"
    },
    {
      "Travel_mode": "Driving",
      "Direction": "State Hwy 71 W and I-35 N",
      "Time": "22 min",
      "Distance": "14.2 miles"
    }
  ]
}

Description

  • The response includes detailed directions between the starting and destination locations. It provides GPS coordinates and other relevant details for each location, along with the directions data.

Note: Replace Your_Access_Token with your actual API access token.