| name | Instagram API |
| description | Post to Instagram (Feed, Story, Reels, Carousel) and Threads using the official Meta Graph API. Requires Imgur for media hosting. |
| version | 1.1.0 |
| author | raon |
| requires_env | ["INSTAGRAM_ACCESS_TOKEN","INSTAGRAM_BUSINESS_ACCOUNT_ID","IMGUR_CLIENT_ID"] |
instagram-api
Meta Graph API๋ฅผ ์ฌ์ฉํด Instagram๊ณผ Threads์ ์ง์ ํฌ์คํ
ํ๋ ์คํฌ.
๋ฏธ๋์ด ํธ์คํ
์ Imgur API๋ฅผ ์ฌ์ฉ (์ด๋ฏธ์ง/์์ ๊ณต๊ฐ URL ์์ฑ).
Imgur Client ID ๋ฐ๊ธ
Instagram Graph API๋ ๊ณต๊ฐ URL๋ก๋ง ๋ฏธ๋์ด๋ฅผ ์
๋ก๋ํ ์ ์์ด Imgur๊ฐ ํ์ํฉ๋๋ค.
- https://api.imgur.com/oauth2/addclient ์ ์
- Application name: ์ํ๋ ์ด๋ฆ (์:
raon-instagram)
- Authorization type:
Anonymous usage without user authorization ์ ํ
- Authorization callback URL:
https://localhost (Anonymous์ด๋ฏ๋ก ํ์๋ง ๋ง์ถ๋ฉด ๋จ)
- ์ด๋ฉ์ผ ์
๋ ฅ ํ ์ ์ถ โ Client ID ํ์ธ
- ํ๊ฒฝ๋ณ์ ์ค์ :
export IMGUR_CLIENT_ID="your_client_id_here"
ํ๊ฒฝ๋ณ์ ์ค์
export INSTAGRAM_ACCESS_TOKEN="your_token_here"
export INSTAGRAM_BUSINESS_ACCOUNT_ID="your_account_id_here"
export THREADS_ACCESS_TOKEN="your_threads_token_here"
export THREADS_USER_ID="your_threads_user_id_here"
export IMGUR_CLIENT_ID="your_imgur_client_id_here"
Meta Graph API ํ ํฐ ๋ฐ๊ธ
- Meta for Developers ์ ์
- ์ฑ ์์ฑ โ Business ์ ํ ์ ํ
- Instagram Graph API ์ ํ ์ถ๊ฐ
- ๊ถํ ์์ฒญ:
instagram_basic
instagram_content_publish
pages_read_engagement
- Access Token ๋ฐ๊ธ:
- Business Account ID ํ์ธ:
curl "https://graph.facebook.com/v21.0/me/accounts?access_token=YOUR_TOKEN"
๐ก Imgur Client ID: https://api.imgur.com/oauth2/addclient (Anonymous usage ์ ํ)
์คํฌ๋ฆฝํธ ์ฌ์ฉ๋ฒ
ํผ๋ ํฌ์คํ
bash scripts/post-feed.sh <์ด๋ฏธ์ง๊ฒฝ๋ก> <์บก์
ํ์ผ>
bash scripts/post-feed.sh ./photo.jpg ./caption.txt
์คํ ๋ฆฌ ํฌ์คํ
bash scripts/post-story.sh <์ด๋ฏธ์ง๊ฒฝ๋ก>
bash scripts/post-story.sh ./story.jpg
๋ฆด์ค ํฌ์คํ
bash scripts/post-reels.sh <์์๊ฒฝ๋ก> <์บก์
ํ์ผ>
bash scripts/post-reels.sh ./reel.mp4 ./caption.txt
์บ๋ฌ์
ํฌ์คํ
bash scripts/post-carousel.sh <์บก์
ํ์ผ> <์ด๋ฏธ์ง1> <์ด๋ฏธ์ง2> [์ด๋ฏธ์ง3...]
bash scripts/post-carousel.sh ./caption.txt ./img1.jpg ./img2.jpg ./img3.jpg
Threads ํฌ์คํ
bash scripts/post-threads.sh <์บก์
ํ์ผ> [์ด๋ฏธ์งURL]
bash scripts/post-threads.sh ./caption.txt
bash scripts/post-threads.sh ./caption.txt "https://example.com/image.jpg"
ํ์ผ ๊ตฌ์กฐ
instagram-api/
โโโ SKILL.md # ์ด ํ์ผ
โโโ scripts/
โโโ post-feed.sh # ํผ๋ ํฌ์คํ
โโโ post-story.sh # ์คํ ๋ฆฌ ํฌ์คํ
โโโ post-reels.sh # ๋ฆด์ค ํฌ์คํ
โโโ post-carousel.sh # ์บ๋ฌ์
ํฌ์คํ
โโโ post-threads.sh # Threads ํฌ์คํ
์ฃผ์์ฌํญ
- Instagram์ ๊ณต๊ฐ URL๋ก๋ง ๋ฏธ๋์ด ์
๋ก๋ ๊ฐ๋ฅ (๋ก์ปฌ ํ์ผ ์ง์ ์
๋ก๋ ๋ถ๊ฐ)
- ์ด ์คํฌ์ Imgur๋ฅผ ํตํด ์์ ๊ณต๊ฐ URL ์์ฑ
- ๋ฆด์ค ๋์์ ์ฒ๋ฆฌ์๋ ์๋ถ ์์๋ ์ ์์
- API ํธ์ถ ์คํจ ์
~/logs/sns/ ๋ก๊ทธ ํ์ธ