Universal Google Drive ID Extractor

A free, open-source API utility to extract Document, Sheet, File, or Folder IDs from any Google Drive URL.

This tool solves a common problem in automation, which is needing to get the Google Drive/Docs ID from the full URL, to use the ID in a module. Instead of rebuilding the same "Get ID" logic via regex in every workflow (and paying operations/credits for it in tools like Make.com or other AI agent tools), you can just call this single, free API.

It follows the "Don't Repeat Yourself" (DRY) principle, making your automations cleaner, cheaper, and easier to maintain.

How to Use This API

Make a POST request to the endpoint:

https://universal-google-drive-id-extractor.vercel.app/api

1. Single URL

Send a JSON body with a single url:

{
  "url": "https://docs.google.com/document/d/1aBcD_.../edit"
}

A successful request will return:

{
  "googleDriveID": "1aBcD_...",
  "success": true,
  "error": null
}

If no valid ID can be found, you will get:

{
  "googleDriveID": null,
  "success": false,
  "error": "Could not find a valid Google Drive ID in the provided URL or text."
}

2. Batch (Multiple) URLs

Send an array of URLs in a urls key:

{
  "urls": [
    "https://docs.google.com/document/d/1aBcD_.../edit",
    "https://drive.google.com/drive/folders/2bCdE_...",
    "https://invalid.url/foo"
  ]
}

A successful request will return an items array and meta object:

{
  "items": [
    {
      "index": 0,
      "input": "https://docs.google.com/document/d/1aBcD_.../edit",
      "googleDriveID": "1aBcD_...",
      "success": true,
      "error": null
    },
    {
      "index": 1,
      "input": "https://drive.google.com/drive/folders/2bCdE_...",
      "googleDriveID": "2bCdE_...",
      "success": true,
      "error": null
    },
    {
      "index": 2,
      "input": "https://invalid.url/foo",
      "googleDriveID": null,
      "success": false,
      "error": "No valid Google Drive ID found in this input."
    }
  ],
  "meta": {
    "total": 3,
    "succeeded": 2,
    "failed": 1
  }
}

In Make.com or n8n, you can iterate over the items array and filter by success for clean downstream processing.