Skip to content

Welcome to SmartDev's Instagram Scraper API! πŸš€ This powerful and user-friendly API allows you to extract direct media URLs (images and videos) from Instagram posts with ease. Owner [@abirxdhack]

License

Notifications You must be signed in to change notification settings

TheSmartDevs/Insta-Scrapper-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartDev's Instagram Scraper API 🌟

GitHub stars GitHub forks GitHub issues License

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.


🌟 Features

  • 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.

πŸš€ Getting Started

Prerequisites

  • A valid Instagram account with session cookies (sessionid and csrftoken).
  • Basic knowledge of HTTP requests and JSON.
  • Node.js or any HTTP client for testing (e.g., Postman, cURL).

Installation

  1. Clone the Repository:

    git clone https://github.com/TheSmartDevs/Insta-Scrapper-API.git
    cd Insta-Scrapper-API
  2. Install Dependencies:

    npm install
  3. 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
      
  4. Run the API:

    npm start
  5. Access the API:

    • The API will be available at http://localhost:3000 (or your deployed URL, e.g., https://its-smart-dev.vercel.app).

πŸ“š API Documentation

Endpoint: GET /download

Extract media URLs from an Instagram post or reel.

Request

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/"

Response (Success)

{
  "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"
}

Response (Error)

{
  "status": "error",
  "message": "URL Required To Download Your Desired Media!",
  "media_urls": [],
  "title": null,
  "author": null,
  "developer": "API Developer : @ISmartDevs",
  "channel": "Updates Channel : @TheSmartDev"
}

Notes

  • Requires valid Instagram session cookies in cookies/cookies.txt with sessionid and csrftoken.
  • The URL must be in the format https://www.instagram.com/p/XXXXX/ for posts or https://www.instagram.com/reel/XXXXX/ for reels.
  • Query parameters (e.g., ?igsh=...) are ignored by the API.

πŸ› οΈ Usage Example

Using JavaScript (Fetch)

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));

Using Python (Requests)

import requests

url = "https://www.instagram.com/reel/XXXXX/"
response = requests.get(f"https://your-api-url/download?url={url}")
print(response.json())

🌍 Contributing

We love contributions! πŸ’– Follow these steps to contribute:

  1. Fork the Repository 🍴
  2. Create a Branch:
    git checkout -b feature-branch
  3. Commit Changes:
    git commit -m "Add new feature"
  4. Push to Branch:
    git push origin feature-branch
  5. Open a Pull Request πŸ“¬

Check out the repository on GitHub.


πŸ“¬ Contact Us

Join our community and stay updated:


πŸ† Acknowledgments


πŸ“ License

This project is licensed under the MIT License.


Β© 2025 SmartDev's Instagram Scraper API | Powered by TheSmartDev

About

Welcome to SmartDev's Instagram Scraper API! πŸš€ This powerful and user-friendly API allows you to extract direct media URLs (images and videos) from Instagram posts with ease. Owner [@abirxdhack]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published