{"id":22767984,"url":"https://github.com/dvarelap/ig","last_synced_at":"2025-04-15T01:37:38.626Z","repository":{"id":39974900,"uuid":"247845879","full_name":"dvarelap/ig","owner":"dvarelap","description":"Instagram Basic Display API in Golang","archived":false,"fork":false,"pushed_at":"2024-01-24T17:07:20.000Z","size":56,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T13:37:45.441Z","etag":null,"topics":["basic-display-api","go","instagram"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvarelap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-17T00:41:19.000Z","updated_at":"2022-07-23T14:39:11.000Z","dependencies_parsed_at":"2024-06-19T06:29:26.581Z","dependency_job_id":null,"html_url":"https://github.com/dvarelap/ig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvarelap%2Fig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvarelap%2Fig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvarelap%2Fig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvarelap%2Fig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvarelap","download_url":"https://codeload.github.com/dvarelap/ig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248990470,"owners_count":21194761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic-display-api","go","instagram"],"created_at":"2024-12-11T14:09:20.646Z","updated_at":"2025-04-15T01:37:38.610Z","avatar_url":"https://github.com/dvarelap.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/dvarelap/ig.svg?branch=master)](https://travis-ci.org/dvarelap/ig)\n\n# Instagram Basic Display API in Golang\n\nThis is a Go package that fully supports the [Instagram Basic Display API.](https://developers.facebook.com/docs/instagram-basic-display-api/)\n\nFeel free to create an issue or send me a pull request if you have any \"how-to\" question or bug or suggestion when using this package. I'll try my best to reply it.\n\n## Install\n\nInstall this package with `go get github.com/dvarelap/ig.git`\n\n## Usage\n\n### Get profile from a ig user.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/dvarelap/ig.git\"\n)\n\nfunc main() {\n\tvar (\n\t\tclient       = ig.NewClient(\"\u003cACCESS_TOKEN\u003e\")\n\t\tprofile, err = client.GetProfile()\n\t)\n        \n    \tcheckIfErr(err)\n\n\tfmt.Println(\"Here's my profile:\", profile)\n}\n``` \n\nThe type of **profile** is `ig.Profile` struct, which has the following structure\n\n```go\ntype Profile struct {\n\tID          string\n\tUsername    string\n\tAccountType string\n\tMediaCount  string\n}\n```\n\nand represents fields on [User's fields](https://developers.facebook.com/docs/instagram-basic-display-api/reference/user#fields)\n\n### Get user's media.\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/dvarelap/ig.git\"\n)\n\nfunc main() {\n\tvar (\n\t\tclient       = ig.NewClient(\"\u003cACCESS_TOKEN\u003e\")\n\t\tmedia, err = client.GetMedia()\n\t)\n\n\tcheckIfErr(err)\n\n\tfmt.Println(\"User's media:\")\n\tfor _, entry := range media {\n\t\tfmt.Println(entry)\n\t}\n}\n```\n\n**Media** is a slice of type `ig.Entry` struct,  which has the following structure\n```go\ntype Entry struct {\n\tID           string\n\tUsername     string\n\tCaption      string\n\tMediaType    string\n\tMediaURL     string\n\tPermalink    string\n\tThumbnailURL string\n\tTimestamp    string\n}\n```\n\nand represents fields on [Media](https://developers.facebook.com/docs/instagram-basic-display-api/reference/media#fields)\n\n\n### Exchange access token for a long lived token.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/dvarelap/ig.git\"\n)\n\nfunc main() {\n\tvar (\n\t\tclient     = ig.NewClient(\"\u003cACCESS_TOKEN\u003e\")\n\t\ttoken, err = client.LongLivedToken(\"\u003cCLIENT_SECRET\u003e\")\n\t)\n\n\tcheckIfErr(err)\n\n\tfmt.Println(\"This is my token:\", token)\n}\n```\n\nThe type of **token** is `ig.LongLiveToken` struct, which has the following structure\n\n```go\ntype LongLiveToken struct {\n\tAccessToken string\n\tTokenType   string\n\tExpiresIn   int64 \n}\n```\n\nit represents Long Lived Token from described [here](https://developers.facebook.com/docs/instagram-basic-display-api/guides/long-lived-access-tokens).\n\n## Licence\nThis package is licensed under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvarelap%2Fig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvarelap%2Fig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvarelap%2Fig/lists"}