Welcome to SmartDev's Instagram Scraper API! π This API allows developers to extract direct media URLs (images and videos) from Instagram posts and reels using a simple and reliable endpoint. Designed for developers and data enthusiasts, this open-source project provides clear documentation to integrate Instagram media scraping into your applications.
- Fast & Reliable: Extract media URLs from Instagram posts and reels quickly.
- Simple Endpoint: Use a single GET request with a URL query parameter.
- Open Source: Fully open-source and community-driven.
- Comprehensive Documentation: Clear examples and notes for easy integration.
- A valid Instagram account with session cookies (
sessionid
andcsrftoken
). - Basic knowledge of HTTP requests and JSON.
- Node.js or any HTTP client for testing (e.g., Postman, cURL).
-
Clone the Repository:
git clone https://github.com/TheSmartDevs/Insta-Scrapper-API.git cd Insta-Scrapper-API
-
Install Dependencies:
npm install
-
Configure Cookies:
- Add your Instagram session cookies in
cookies/cookies.txt
in Netscape format. - Example:
# Netscape HTTP Cookie File .instagram.com TRUE / FALSE 0 sessionid your_session_id .instagram.com TRUE / FALSE 0 csrftoken your_csrf_token
- Add your Instagram session cookies in
-
Run the API:
npm start
-
Access the API:
- The API will be available at
http://localhost:3000
(or your deployed URL, e.g.,https://its-smart-dev.vercel.app
).
- The API will be available at
Extract media URLs from an Instagram post or reel.
curl -X GET "https://your-api-url/download?url=https://www.instagram.com/p/XXXXX/"
curl -X GET "https://your-api-url/download?url=https://www.instagram.com/reel/XXXXX/"
{
"status": "success",
"message": "Media URLs extracted successfully.",
"media_urls": [
"https://instagram.com/.../media1.jpg",
"https://instagram.com/.../media2.mp4"
],
"title": "Post caption",
"author": "username",
"developer": "API Developer : @ISmartDevs",
"channel": "Updates Channel : @TheSmartDev"
}
{
"status": "error",
"message": "URL Required To Download Your Desired Media!",
"media_urls": [],
"title": null,
"author": null,
"developer": "API Developer : @ISmartDevs",
"channel": "Updates Channel : @TheSmartDev"
}
- Requires valid Instagram session cookies in
cookies/cookies.txt
withsessionid
andcsrftoken
. - The URL must be in the format
https://www.instagram.com/p/XXXXX/
for posts orhttps://www.instagram.com/reel/XXXXX/
for reels. - Query parameters (e.g.,
?igsh=...
) are ignored by the API.
const url = "https://www.instagram.com/p/XXXXX/";
fetch(`https://your-api-url/download?url=${encodeURIComponent(url)}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
import requests
url = "https://www.instagram.com/reel/XXXXX/"
response = requests.get(f"https://your-api-url/download?url={url}")
print(response.json())
We love contributions! π Follow these steps to contribute:
- Fork the Repository π΄
- Create a Branch:
git checkout -b feature-branch
- Commit Changes:
git commit -m "Add new feature"
- Push to Branch:
git push origin feature-branch
- Open a Pull Request π¬
Check out the repository on GitHub.
Join our community and stay updated:
- Instagram: @ISmartDevs
- Telegram: TheSmartDev
- GitHub: @TheSmartDevs
- Built with β€οΈ by TheSmartDevs.
- Powered by Bootstrap, Font Awesome, and GSAP for the documentation site.
- Special thanks to our contributors! π
This project is licensed under the MIT License.
Β© 2025 SmartDev's Instagram Scraper API | Powered by TheSmartDev