{"id":25121671,"url":"https://github.com/backaged/instabot","last_synced_at":"2025-06-25T20:06:29.586Z","repository":{"id":40368321,"uuid":"395651901","full_name":"BackAged/instabot","owner":"BackAged","description":"Instagram Messaging API GO SDK","archived":false,"fork":false,"pushed_at":"2022-05-12T12:37:05.000Z","size":50,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-22T23:36:56.386Z","etag":null,"topics":["go","go-instagram","go-instagram-sdk","golang","instagram","instagram-api","instagram-bot","sdk","sdk-go"],"latest_commit_sha":null,"homepage":"https://developers.facebook.com/docs/messenger-platform/instagram","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/BackAged.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-13T12:45:34.000Z","updated_at":"2025-03-12T00:44:49.000Z","dependencies_parsed_at":"2022-08-09T18:23:54.741Z","dependency_job_id":null,"html_url":"https://github.com/BackAged/instabot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/BackAged/instabot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackAged%2Finstabot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackAged%2Finstabot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackAged%2Finstabot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackAged%2Finstabot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BackAged","download_url":"https://codeload.github.com/BackAged/instabot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackAged%2Finstabot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261945376,"owners_count":23234237,"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":["go","go-instagram","go-instagram-sdk","golang","instagram","instagram-api","instagram-bot","sdk","sdk-go"],"created_at":"2025-02-08T06:32:43.997Z","updated_at":"2025-06-25T20:06:29.530Z","avatar_url":"https://github.com/BackAged.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instagram Messaging API GO SDK\n\n[![Build Status](https://github.com/BackAged/instabot/actions/workflows/go.yaml/badge.svg?branch=master)](https://github.com/BackAged/instabot/actions/workflows/go.yaml)\n[![codecov](https://codecov.io/gh/BackAged/instabot/branch/master/graph/badge.svg)](https://codecov.io/gh/BackAged/instabot)\n[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/BackAged/instabot)\n[![Go Report Card](https://goreportcard.com/badge/github.com/BackAged/instabot)](https://goreportcard.com/report/github.com/BackAged/instabot)\n[![CodeQL](https://github.com/BackAged/instabot/actions/workflows/codeql-analysis.yaml/badge.svg?branch=master)](https://github.com/BackAged/instabot/actions/workflows/codeql-analysis.yaml)\n\n[![Run on Repl.it](https://repl.it/badge/github/BackAged/instabot)](https://repl.it/github/BackAged/instabot)\n\n## Introduction\nInstabot, Instagram Messaging API GO SDK makes it easy to work with instagram messaging API.\nIt uses Instagram messaging API latest version - `v11.0`\n\n## Requirements\n\nInstabot requires Go 1.13 or later.\n\n## Installation ##\n\n```sh\n$ go get -u github.com/BackAged/instabot\n```\n\n## Instabot configuration\n\n```go\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/BackAged/instabot\"\n)\n\nfunc main() {\n    // instantiating instabot.\n\tbot, err := instabot.New(\"your_instagram_business_account_page_access_token\")\n    ...\n\n    // instantiating with http.Client\n    bot, err := instabot.New(\n        \"your_instagram_business_account_page_access_token\",\n        instabot.WithHTTPClient(yourHttpClient)\n    )\n    ...\n\n    // instantiating with mock api server\n    bot, err := instabot.New(\n        \"your_instagram_business_account_page_access_token\",\n        instabot.APIEndpointBase(\"http://your_mock_api_server.com\")\n    )\n    ...\n\n}\n```\n\n## Example\n\n```go\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/BackAged/instabot\"\n)\n\nfunc main() {\n    // See examples directory for more example.\n    \n    // instantiating instabot.\n\tbot, err := instabot.New(\"your_instagram_business_account_page_access_token\")\n    ...\n\n    \n    // Send text message.\n\t_, err = bot.SendMessage(\n\t\tcontext.Background(),\n\t\t\"instagram_user_id_you_want_to_send_message_to\",\n\t\tinstabot.NewTextMessage(\"hello\"),\n\t)\n    ...\n\n    // Set icebreakers\n    _, err = bot.SetIceBreakers(\n\t\tcontext.Background(),\n\t\t[]*instabot.IceBreaker{\n\t\t\tinstabot.NewIceBreaker(\"frequently asked question 1\", \"user payload\"),\n\t\t\tinstabot.NewIceBreaker(\"frequently asked question 2\", \"user payload\"),\n\t\t\tinstabot.NewIceBreaker(\"frequently asked question 3\", \"user payload\"),\n\t\t\tinstabot.NewIceBreaker(\"frequently asked question 4\", \"user payload\"),\n\t\t},\n\t)\n    ...\n\n    // Get user profile.\n\tprofile, err := bot.GetUserProfile(\n\t\tcontext.Background(),\n\t\t\"instagram_user_id_you_want_to_get_profile\",\n\t)\n    ...\n\n\t// work with webhook events.\n\tpayload := []byte(`{\n\t\t\"object\": \"instagram\",\n\t\t\"entry\": [\n\t\t  {\n\t\t\t\"id\": \"\u003cIGID\u003e\",\n\t\t\t\"time\": 1569262486134,\n\t\t\t\"messaging\": [\n\t\t\t  {\n\t\t\t\t\"sender\": {\n\t\t\t\t  \"id\": \"\u003cIGSID\u003e\"\n\t\t\t\t},\n\t\t\t\t\"recipient\": {\n\t\t\t\t  \"id\": \"\u003cIGID\u003e\"\n\t\t\t\t},\n\t\t\t\t\"timestamp\": 1569262485349,\n\t\t\t\t\"message\": {\n\t\t\t\t  \"mid\": \"\u003cMESSAGE_ID\u003e\",\n\t\t\t\t  \"text\": \"\u003cMESSAGE_CONTENT\u003e\"\n\t\t\t\t}\n\t\t\t  }\n\t\t\t]\n\t\t  }\n\t\t],\n\t}`)\n\n\twebhookEvent := new(instabot.WebhookEvent)\n\n\tif err := json.Unmarshal(payload, webhookEvent); err != nil {\n\t\tlog.Fatal(\"failed to unmarshal event\")\n\t}\n\n\tfor _, entry := range webhookEvent.Entries {\n\t\tfor _, event := range entry.Messaging {\n\t\t\tswitch event.Type {\n\t\t\tcase instabot.WebhookEventTypeEcho:\n\t\t\tcase instabot.WebhookEventTypeDeleted:\n\t\t\t\tlog.Println(event.GetMessageDeleteEvent())\n\t\t\tcase instabot.WebhookEventTypeUnsupported:\n\t\t\tcase instabot.WebhookEventTypeMessageSeen:\n\t\t\t\tlog.Println(event.GetMessageSeenEvent())\n\t\t\tcase instabot.WebhookEventTypeMessageReply:\n\t\t\t\tlog.Println(event.GetMessageReplyEvent())\n\t\t\tcase instabot.WebhookEventTypeShare:\n\t\t\t\tlog.Println(event.GetMessageShareEvent())\n\t\t\tcase instabot.WebhookEventTypeReaction:\n\t\t\t\tlog.Println(event.GetMessageReactionEvent())\n\t\t\tcase instabot.WebhookEventTypeTextMessage:\n\t\t\t\tlog.Println(event.GetTextMessageEvent())\n\t\t\tcase instabot.WebhookEventTypeImageMessage:\n\t\t\t\tlog.Println(event.GetMediaMessageEvent())\n\t\t\tcase instabot.WebhookEventTypeAudioMessage:\n\t\t\t\tlog.Println(event.GetMediaMessageEvent())\n\t\t\tcase instabot.WebhookEventTypeVideoMessage:\n\t\t\t\tlog.Println(event.GetMediaMessageEvent())\n\t\t\tcase instabot.WebhookEventTypeFileMessage:\n\t\t\t\tlog.Println(event.GetMediaMessageEvent())\n\t\t\tcase instabot.WebhookEventTypeQuickReply:\n\t\t\t\tlog.Println(event.GetQuickReplyEvent())\n\t\t\tcase instabot.WebhookEventTypePostBack:\n\t\t\t\tlog.Println(event.GetPostBackEvent())\n\t\t\tcase instabot.WebhookEventTypeStoryMention:\n\t\t\t\tlog.Println(event.GetStoryMentionEvent())\n\t\t\tcase instabot.WebhookEventTypeStoryReply:\n\t\t\t\tlog.Println(event.GetStoryReplyEvent())\n\t\t\tdefault:\n\t\t\t\tlog.Println(\"unexpected event\")\n\t\t\t}\n\t\t}\n\t}\n\t...\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackaged%2Finstabot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackaged%2Finstabot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackaged%2Finstabot/lists"}