https://github.com/deadpool2000/short-url-expander-api
An API to expand Short URL with all possible redirections
https://github.com/deadpool2000/short-url-expander-api
api apis flask flask-api flask-application flaskapplication python python-api python3 rest-api restapi restful-api short-url-expander url-shortener
Last synced: 14 days ago
JSON representation
An API to expand Short URL with all possible redirections
- Host: GitHub
- URL: https://github.com/deadpool2000/short-url-expander-api
- Owner: Deadpool2000
- License: mit
- Created: 2024-09-28T17:24:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-05T05:20:42.000Z (over 1 year ago)
- Last Synced: 2025-10-21T07:37:47.668Z (7 months ago)
- Topics: api, apis, flask, flask-api, flask-application, flaskapplication, python, python-api, python3, rest-api, restapi, restful-api, short-url-expander, url-shortener
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Short URL Expander API
The **Short URL Expander API** allows you to expand shortened URLs and follow all possible redirections. This API is useful when you want to trace the final destination of a shortened URL.
## Features
- Expand shortened URLs
- Follow all possible redirections
- Get the final destination URL
## Installation
git clone https://github.com/Deadpool2000/Short-URL-Expander-API
pip install flask
cd Short-URL-Expander-API/
After this, just run code -
python3 app.py
## API Endpoints
### `GET /extract`
Expands a shortened URL by following all redirections until the final destination URL is reached.
#### Request
- **URL**: `/extract`
- **Method**: `GET`
#### Body Parameters:
| Parameter | Type | Description | Required |
|-----------|--------|------------------------------------|----------|
| `url` | string | The shortened URL to be expanded | Yes |
Example (Local Testing):
```
https://127.0.0.1:5000/extract?url=https://bit.ly/example
```
## Example Output
This is an example short link -
https://bit.ly/3Bg19uM
Expected output will be -
```
{
"All Possible Redirections": [
"https://www.usatoday.com/story/travel/2022/02/10/amtrak-deal-valentines-offer-sale/6741296001/",
"https://www.usatoday.com/story/travel/2022/02/10/amtrak-deal-valentines-offer-sale/6741296001/"
],
"Full Link": "https://www.usatoday.com/story/travel/2022/02/10/amtrak-deal-valentines-offer-sale/6741296001/",
"Original URL": "https://bit.ly/3Bg19uM"
}
```