instagram_graph_api.cr v0.1.0

Instagram Graph API client for crystal

instagram_graph_api

An API Client for Instagram Graph API.

You can get:

  • Business accounts
  • User details
  • Recent posted media
  • Media details
  • Media Insights

Supported media:

  • Image
  • Video/Reel
  • Story

You can only get data, not update or post right now.

Based on the Ruby library https://github.com/rakeshpatra/instagram_graph_api

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      instagram_graph_api:
        github: confact/instagram_graph_api.cr
    
  2. Run shards install

Usage

require "instagram_graph_api"
access_token = "your_access_token"

instagram = InstagramGraphApi::Client.new(access_token)

p! instagram.ig_business_accounts # list of all business accounts for these access token
p! instagram.business_account_id # only return the business account id, for api calls like below
p! instagram.user_recent_media(instagram.business_account_id)
p! instagram.user_recent_media(instagram.business_account_id, type: "story") # get stories
p! instagram.insights("media_id")

Development

TODO: Write development instructions here

Contributing

  1. Fork it (https://github.com/confact/instagram_graph_api.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

instagram_graph_api.cr

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • over 1 year ago
  • August 17, 2022
License

MIT License

Links
Synced at

Thu, 16 May 2024 22:08:31 GMT

Languages