Skip to content

The C++ library provides a simple interface for working with public Instagram API

License

Notifications You must be signed in to change notification settings

Dissfall/Instagram-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram C++

The C++ library provides a simple interface for working with public Instagram API

Requires

  • curlpp
  • The library works according to the standard С++14 (С++11 tested)

Instagram REST and Search APIs

Documentation and last news the Instagram API you can find on Instagram developer site

Blog

You can find me in social networks by username dissfall: (Vero, twitter, instagram...)

Authentication

Library uses Instagram access token to provide functionality. How get access token you can find there: https://instagram.com/developer/authentication/

Instalation

Ubuntu / Debian

Dependencies instalation:

$ sudo apt install libcurl-dev
$ git clone https://github.com/jpbarrette/curlpp.git
$ cd curlpp
$ cmake .
$ sudo make install

Library instalation:

$ git clone https://github.com/Dissfall/Instagram-cpp.git
$ cd ./Instagram-cpp
$ mkdir ./build && cd ./build
$ cmake ..
$ make 
$ sudo make install

SUSE

Dependencies instalation:

$ sudo zypper in libcurl-devel
$ git clone https://github.com/jpbarrette/curlpp.git
$ cd curlpp
$ cmake .
$ sudo make install

Library instalation:

$ git clone https://github.com/Dissfall/Instagram-cpp.git
$ cd ./Instagram-cpp
$ mkdir ./build && cd ./build
$ cmake ..
$ make 
$ sudo make install

Example of use

#include <iostream>

#include "inslib.h"

using namespace std;

int main(int argc, char *argv[]) {
    Session session(YOUR_ACCESS_TOKEN);

    cout << session.getUsersSelf();

    return 0;
}

Endpoints

All endpoints resurns string type

Users

getUsersSelf()

Returns information about the owner of the access_token https://instagram.com/developer/endpoints/users/#get_users_self

getUsersSelfRecentMedia()

Returns the most recent media published by the owner of the access_token https://instagram.com/developer/endpoints/users/#get_users_media_recent_self

searchAreaRecentMedia(double lat = 0, double lng = 0, int distance = 1000)

or searchAreaRecentMedia(int distance = 1000) Returns result search for recent media in a given area lat -- latitude of the center search coordinate lng -- longitude of the center search coordinate distance -- radius of searching area https://instagram.com/developer/endpoints/media/#get_media_search

getMediaComments(string mediaId)

Returns a list of recent comments on your media object https://instagram.com/developer/endpoints/comments/#get_media_comments

getTagInfo(string tagName)

Returns information about a tag object https://instagram.com/developer/endpoints/tags/#get_tags

getTagRecentMedia(string tagName)

Returns a list of recently tagged media https://instagram.com/developer/endpoints/tags/#get_tags_media_recent

searchTag(string tagName)

Returns result of searching tag by name https://instagram.com/developer/endpoints/tags/#get_tags_search

getLocationInfo(string locationId)

Returns information about a location https://instagram.com/developer/endpoints/locations/#get_locations

getLocationRecentMedia(string locationId)

Returns a list of recent media objects from a given location https://instagram.com/developer/endpoints/locations/#get_locations_media_recent

searchLocation(double lat, double lng)

Returns result of searching for a location by geographic coordinate https://instagram.com/developer/endpoints/locations/#get_locations_search

Contributing

Here are some ways you can contribute:

  • by using alpha, beta, and prerelease versions
  • by support author on patreon
  • by reporting bugs
  • by suggesting new features
  • by writing or editing documentation
  • by writing specifications
  • by writing code
  • by reviewing patches

About

The C++ library provides a simple interface for working with public Instagram API

Resources

License

Stars

Watchers

Forks

Packages

No packages published