C++ Instagram API
A header-only version of Instagram Private API in C++
Getting started.
Steps
This API is tested with C++ 14, on linux g++ and on Visual Studio 2017/2019.
Windows
- Install dependencies with VCPKG
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg install jsoncpp
vcpkg install cpr
vcpkg integrate install
- Clone the repository
git clone https://github.com/deni2312/InstagramAPI.git
- Open CMakeFile on Visual Studio
Files->Open->CMake->Instagram Directory
Linux
Install on linux with vcpkg:
- Dependencies
- Jsoncpp
- cpr
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install jsoncpp
./vcpkg install cpr
./vcpkg integrate install
With CMake:
cd InstagramAPI
mkdir build
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=vcpkgdirectory/scripts/buildsystems/vcpkg.cmake
cd build
cmake --build .
./Instagram
Change vcpkgdirectory with the relative or absolute path of vcpkg
Writing your first bot
Hello World!
#include "include/Instagram.h"
int main()
{
Instagram instagram{"username", "password"};
try {
instagram.login();
}
catch (Network::Error& e) {
std::cerr << e.what();
}
}
General API Documentation
Usage
All the operations returns a Json::Value
that contains all informations about the request.
Error Handling
To handle errors you only need to catch Network::Error &e
and the output of e.what()
will be the JSON error returned by instagram.
Contacts
You can contact us on Telegram for any issue or doubt.
@deni2312