Help with Unshorten URL

Hi, I have a shortened URL (example: abc.de/xxxxxx). I want to unshort it using n8n but don’t have any idea how to do it. Please help me out. Thank you so much!

Hi @miniduke, welcome to the community!

You should be able to use the HTTP Request node with the Full Response and Ignore Response Code options enabled and Follow GET Redirect disabled for this. You can then read the location header to see the unshortened URL:

Example Workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://bit.ly/3ETbVrr",
        "responseFormat": "string",
        "options": {
          "fullResponse": true,
          "followRedirect": false,
          "ignoreResponseCode": true
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hope this helps! Let me know if you have any questions on this :slight_smile:

3 Likes

Thanks @MutedJam ! I’ll try and let you know if it works.

1 Like

Oh this is something that the OneSimpleAPI node that I popped together could do, Until it gets merged in though you can use their API in an HTTP Request node (OneSimpleApi.com)

1 Like

Even better, I did not know that. Thanks a lot for sharing Jon!