Skip to content

Instagram API - 用户已发布帖子 (V1)

prod-global
GET
/api/instagram/get-user-posts/v1

检索Instagram用户发布的公开帖子列表,包括帖子代码、标题、媒体类型、发布时间和基本互动指标。

典型用例:

  • 监控特定用户的近期发布活动
  • 为审计或分析构建内容历史记录
  • 收集帖子标识符以进行更深入的互动分析

请求参数

参数名位置类型必填说明
tokenquerystringAPI服务的访问令牌。
usernamequerystring要检索其已发布帖子的Instagram用户名。
paginationTokenquerystring用于检索下一页结果的令牌。

代码示例

💡 环境说明

默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择

bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE"
text
我想使用 Just One API 提供的“用户已发布帖子 (V1)”接口。
接口地址: https://api.justoneapi.com/api/instagram/get-user-posts/v1
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/instagram-apis/user-published-posts-v1-zh.json

请求参数说明:
- token (query): API服务的访问令牌。 (必填)
- username (query): 要检索其已发布帖子的Instagram用户名。 (必填)
- paginationToken (query): 用于检索下一页结果的令牌。

返回格式: JSON

响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
   - 0: 成功
   - 100: Token 无效或已失效
   - 301: 采集失败,请重试
   - 302: 超出速率限制
   - 303: 超出每日配额
   - 400: 参数错误
   - 500: 内部服务器错误
   - 600: 权限不足
   - 601: 余额不足

请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。
python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests

url = "https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE"
response = requests.get(url)
print(response.json())
js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE", {
  method: "GET"
});
const data = await response.json();
console.log(data);
java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	client := &http.Client{}
	url := "https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
php
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;

响应结果

json
{
  "code": 0,
  "data": {
    "data": {
      "count": 12,
      "items": [
        {
          "all_previous_submitters": [],
          "boost_unavailable_identifier": null,
          "boost_unavailable_reason": null,
          "boost_unavailable_reason_v2": null,
          "can_modify_carousel": true,
          "can_reply": false,
          "can_reshare": true,
          "can_save": true,
          "caption": {
            "created_at": 1771924645,
            "created_at_utc": 1771924645,
            "did_report_as_spam": false,
            "hashtags": [],
            "id": "3839504654997500385",
            "is_covered": false,
            "is_ranked_comment": false,
            "mentions": [],
            "private_reply_status": 0,
            "share_enabled": false,
            "text": "🐶",
            "type": 1,
            "user": {
              "fbid_v2": "17841406713871030",
              "full_name": "Liu Yifei",
              "id": "6648247795",
              "is_private": false,
              "is_unpublished": false,
              "is_verified": true,
              "profile_pic_id": "1660311735996807053",
              "profile_pic_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/24177964_189054331645767_4251997617082335232_...",
              "username": "yifei_cc"
            },
            "user_id": "6648247795"
          },
          "caption_is_edited": false,
          "carousel_media": [
            {
              "caption": null,
              "carousel_parent_id": "3839504654997500385_6648247795",
              "commerciality_status": "not_commercial",
              "creative_config": null,
              "explore_pivot_grid": false,
              "fb_user_tags": {
                "in": []
              },
              "featured_products": [],
              "id": "3839504236951056417",
              "image_versions": {
                "items": [
                  {
                    "height": 1080,
                    "is_spatial_image": false,
                    "url": "https://scontent-vie1-1.cdninstagram.com/v/t51.82787-15/640487541_18330961855223796_3436654859881952...",
                    "width": 1080
                  }
                ]
              },
              "is_video": false,
              "location": null,
              "media_format": "image",
              "media_name": "album_item",
              "media_overlay_info": null,
              "media_type": 1,
              "original_height": 1440,
              "original_width": 1440,
              "product_suggestions": [],
              "product_type": "carousel_item",
              "sharing_friction_info": {
                "bloks_app_url": null,
                "sharing_friction_payload": null,
                "should_have_sharing_friction": false
              },
              "shop_routing_user_id": null,
              "sponsor_tags": [],
              "tagged_users": [],
              "taken_at": 1771924642,
              "taken_at_date": "2026-02-24T09:17:22+00:00",
              "taken_at_ts": 1771924642,
              "thumbnail_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.82787-15/640487541_18330961855223796_3436654859881952...",
              "video_sticker_locales": []
            }
          ],
          "carousel_media_count": 4,
          "carousel_media_ids": [
            "3839504236951056417"
          ],
          "carousel_media_pending_post_count": 0,
          "clips_tab_pinned_user_ids": [],
          "coauthor_producer_can_see_organic_insights": false,
          "coauthor_producers": [],
          "code": "DVIqSQilbHh",
          "collaborator_edit_eligibility": false,
          "comment_count": 772,
          "comment_inform_treatment": {
            "action_type": null,
            "should_have_inform_treatment": false,
            "text": "",
            "url": null
          },
          "comment_likes_enabled": true,
          "community_notes_info": {
            "enable_submission_friction": false,
            "has_viewer_submitted_note": false,
            "is_eligible_for_request_a_note": true,
            "note_submission_disabled": false
          },
          "creative_config": null,
          "crosspost_metadata": {
            "fb_downstream_use_xpost_metadata": {
              "downstream_use_xpost_deny_reason": "NONE"
            }
          },
          "cutout_sticker_info": [],
          "deleted_reason": 0,
          "device_timestamp": 1771924590379601,
          "eligible_insights_entrypoints": "NONE",
          "fb_user_tags": {
            "in": []
          },
          "fbid": "17951483931080460",
          "featured_products": [],
          "filter_type": 0,
          "floating_context_items": [],
          "fundraiser_tag": {
            "has_standalone_fundraiser": false
          },
          "gen_ai_chat_with_ai_cta_info": null,
          "gen_ai_detection_method": {
            "detection_method": "NONE"
          },
          "has_high_risk_gen_ai_inform_treatment": false,
          "has_liked": false,
          "has_privately_liked": false,
          "has_shared_to_fb": 0,
          "has_views_fetching": true,
          "has_views_fetching_on_search_grid": false,
          "hidden_likes_string_variant": -1,
          "id": "3839504654997500385",
          "ig_media_sharing_disabled": false,
          "igbio_product": null,
          "image_versions": {
            "items": [
              {
                "height": 1080,
                "is_spatial_image": false,
                "url": "https://scontent-vie1-1.cdninstagram.com/v/t51.82787-15/640487541_18330961855223796_3436654859881952...",
                "width": 1080
              }
            ]
          },
          "integrity_review_decision": "pending",
          "invited_coauthor_producers": [],
          "is_comments_gif_composer_enabled": true,
          "is_cutout_sticker_allowed": false,
          "is_eligible_content_for_post_roll_ad": false,
          "is_eligible_for_organic_eager_refresh": true,
          "is_eligible_for_poe": false,
          "is_in_profile_grid": false,
          "is_open_to_public_submission": false,
          "is_organic_product_tagging_eligible": false,
          "is_paid_partnership": false,
          "is_photo_comments_composer_enabled_for_author": false,
          "is_pinned": false,
          "is_quiet_post": false,
          "is_reuse_allowed": false,
          "is_social_ufi_disabled": false,
          "is_tagged_media_shared_to_viewer_profile_grid": false,
          "is_video": false,
          "like_and_view_counts_disabled": false,
          "like_count": 58557,
          "location": null,
          "locations": [],
          "media_attributions_data": [],
          "media_format": "album",
          "media_name": "album",
          "media_notes": {
            "items": []
          },
          "media_overlay_info": null,
          "media_reposter_bottomsheet_enabled": false,
          "media_type": 8,
          "meta_ai_suggested_prompts": [],
          "music_metadata": {
            "audio_canonical_id": "0",
            "audio_type": null,
            "music_info": null,
            "original_sound_info": null,
            "pinned_media_ids": null
          },
          "open_carousel_show_follow_button": false,
          "open_carousel_submission_state": "closed",
          "original_height": 1440,
          "original_width": 1440,
          "product_suggestions": [],
          "product_type": "carousel_container",
          "profile_grid_thumbnail_fitting_style": "UNSET",
          "related_ads_pivots_media_info": "USER_NOT_IN_TEST_GROUP",
          "report_info": {
            "has_viewer_submitted_report": false
          },
          "share_count": 1343,
          "share_count_disabled": false,
          "sharing_friction_info": {
            "bloks_app_url": null,
            "sharing_friction_payload": null,
            "should_have_sharing_friction": false
          },
          "shop_routing_user_id": null,
          "should_show_author_pog_for_tagged_media_shared_to_profile_grid": false,
          "sponsor_tags": [],
          "subscribe_cta_visible": false,
          "subtype_name_for_REST__": "XDTCarouselContainerMedia",
          "tagged_users": [],
          "taken_at": 1771924643,
          "taken_at_date": "2026-02-24T09:17:23+00:00",
          "taken_at_ts": 1771924643,
          "thumbnail_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.82787-15/640487541_18330961855223796_3436654859881952...",
          "timeline_pinned_user_ids": [],
          "top_likers": [],
          "user": {
            "account_badges": [],
            "account_type": 3,
            "aigm_account_label_info": {
              "is_auto_detected": false,
              "is_enabled": false,
              "is_manually_enabled": false
            },
            "can_see_quiet_post_attribution": true,
            "eligible_for_text_app_activation_badge": false,
            "fan_club_info": {
              "autosave_to_exclusive_highlight": null,
              "connected_member_count": null,
              "fan_club_id": null,
              "fan_club_name": null,
              "fan_consideration_page_revamp_eligiblity": null,
              "has_created_ssc": null,
              "has_enough_subscribers_for_ssc": null,
              "is_fan_club_gifting_eligible": null,
              "is_fan_club_referral_eligible": null,
              "is_free_trial_eligible": null,
              "largest_public_bc_id": null,
              "should_show_playlists_in_profile_tab": null,
              "subscriber_count": null
            },
            "fbid_v2": "17841406713871030",
            "feed_post_reshare_disabled": false,
            "full_name": "Liu Yifei",
            "has_anonymous_profile_picture": false,
            "id": "6648247795",
            "is_favorite": false,
            "is_private": false,
            "is_ring_creator": false,
            "is_unpublished": false,
            "is_verified": true,
            "latest_reel_media": 0,
            "profile_pic_id": "1660311735996807053",
            "profile_pic_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/24177964_189054331645767_4251997617082335232_...",
            "show_account_transparency_details": true,
            "show_ring_award": false,
            "third_party_downloads_enabled": 2,
            "transparency_product_enabled": false,
            "user_activation_info": [],
            "username": "yifei_cc"
          },
          "video_sticker_locales": []
        }
      ],
      "user": {
        "full_name": "Liu Yifei",
        "id": "6648247795",
        "is_active_on_text_post_app": false,
        "is_private": false,
        "is_verified": true,
        "profile_pic_id": "1660311735996807053",
        "profile_pic_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/24177964_189054331645767_4251997617082335232_...",
        "username": "yifei_cc"
      }
    },
    "pagination_token": "Ik1IBB8pBBZDZQhSAVFRQQBBME8tQgZCC1kQZn1TX09JXAZAAmgQWARRAU0TETwdXgtHKUcTAToLQzBVAFINEnMDSBEbBh4ZFWUr..."
  }
}

💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。