rapid-api/instagram-scrapper

Get instagram posts and reels from rapid API

dev-master 2025-02-08 11:29 UTC

This package is auto-updated.

Last update: 2025-09-08 12:50:41 UTC


README

This PHP library is designed to fetch posts from Instagram via RapidAPI.

Installation

Install the package using Composer:

composer require rapid-api/instagram-scrapper

Then, run the following command:

composer require rapid-api/instagram-scrapper:dev-main

Usage

Using the package is very simple:

require 'vendor/autoload.php';

use YourVendor\InstagramAPI\InstagramClient;

$apiKey = 'YOUR_RAPIDAPI_KEY';
$instagram = new InstagramClient($apiKey);

$posts = $instagram->getUserPosts('cristiano');

print_r($posts);

Functions

getUserPosts($username)

Fetches posts of a specific user.

$posts = $instagram->getUserPosts('cristiano');

Response Example:

{
    "data": [
        {
            "id": "123456789",
            "caption": "New post!",
            "image": "https://instagram.com/image.jpg",
            "likes": 1500,
            "comments": 300
        }
    ]
}

Requirements

  • PHP 7.3 or higher
  • Composer
  • A registered RapidAPI account with an Instagram API key

License

Distributed under the MIT License.

Author

Mr Oxunjon Abdurashidov
abdurashidovoxunjon@gmail.com

Contributing

If you want to contribute, feel free to submit a pull request or open an issue on the GitHub repository.