This API allows you to download media content from TikTok. You can retrieve video and audio download URLs, along with metadata about the video.
To get started, clone the repository and install the necessary dependencies:
git clone https://github.com/Mahmovdsayed/tiktokAPI.git
cd tiktokAPI
npm install
Starting the Server
To start the server, run:
npm start
The server will be running on port 4000 by default.
GET /download
This endpoint retrieves download URLs for a TikTok video.
Query Parameters:
url (required): The URL of the TikTok video you want to download.
Response:
On success, the response will include:
{
"status": true,
"developer": "API BY MAHMOUD SAYED || https://github.com/Mahmovdsayed",
"metadata": {
"likes": Number,
"plays": Number,
"comment": Number,
"share": Number,
"downloadCount": Number,
"durationInSeconds": Number,
"title": String,
"thumbnail": String,
"url": String
},
"author": {
"id": String,
"unique_id": String,
"nickname": String,
"avatar": String,
"profileURL": String
},
"download": [
{
"url": String,
"quality": "hd",
"extension": "mp4",
"size": Number,
"formattedSize": String,
"videoAvailable": true,
"audioAvailable": true,
"chunked": false,
"cached": false
},
{
"url": String,
"quality": "sd",
"extension": "mp4",
"size": Number,
"formattedSize": String,
"videoAvailable": true,
"audioAvailable": true,
"chunked": false,
"cached": false
},
{
"url": String,
"quality": "watermark",
"extension": "mp4",
"size": Number,
"formattedSize": String,
"videoAvailable": true,
"audioAvailable": true,
"chunked": false,
"cached": false
},
{
"url": String,
"quality": "128kbps",
"extension": "mp3",
"size": Number,
"formattedSize": String,
"videoAvailable": false,
"audioAvailable": true,
"chunked": false,
"cached": false
}
]
}
On failure, the response will include:
{
"status": false,
"error": "Failed to download video"
}
To get the download URLs for a TikTok video:
curl "http://localhost:4000/download?url=https://www.tiktok.com/@username/video/1234567890"
Bad Request: If the url
query parameter is missing 400.
Internal Server Error: If there is an error processing the request 500.
If you would like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries, please contact me.