---
title: "Instagram Bài đăng đã được công bố của người dùng API (V1)"
description: "Lấy thông tin về các bài đăng được đăng bởi người dùng Instagram với chức năng phân trang dựa trên token. Sử dụng để xem qua lịch sử bài đăng của tài khoản đã biết hoặc tiếp tục trên các trang kết quả tiếp theo."
lastUpdated: false
aiUsagePrompt: true
---

# Instagram Bài đăng đã được công bố của người dùng API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/instagram/get-user-posts/v1\"")'
  :summary='JSON.parse("\"Bài đăng đã được công bố của người dùng (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/instagram/user-published-posts-v1-vi.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Token truy cập cho dịch vụ API.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"username\",\"in\":\"query\",\"description\":\"Tên tài khoản Instagram mà các bài đăng đã được công bố cần được lấy lại.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"paginationToken\",\"in\":\"query\",\"description\":\"Token dùng để lấy kết quả trang tiếp theo.\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":[\"object\",\"null\"],\"description\":\"Kết quả tìm kiếm bài đăng Instagram, có thể chứa trang bài đăng hoặc trạng thái truy vấn cùng thông báo lỗi.\",\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Trang bài đăng được trả về khi tìm kiếm cung cấp một trang bài đăng.\",\"properties\":{\"count\":{\"type\":\"integer\",\"description\":\"Số bài đăng của trang theo dữ liệu được báo cáo.\"},\"items\":{\"type\":\"array\",\"description\":\"Các bài đăng Instagram trên trang hiện tại.\",\"items\":{\"type\":\"object\",\"description\":\"Một bài đăng Instagram.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ID truyền thông Instagram cho bài đăng, được trả về dưới dạng văn bản.\"},\"code\":{\"type\":\"string\",\"description\":\"Mã ngắn của Instagram dành cho bài đăng.\"},\"taken_at\":{\"type\":\"integer\",\"description\":\"Thời điểm bài đăng dưới dạng thời gian Unix tính bằng giây.\"},\"media_type\":{\"type\":\"integer\",\"description\":\"Mã loại tệp media của Instagram. Các mã được chú ý bao gồm 1 cho hình ảnh, 2 cho video, và 8 cho carousel.\"},\"product_type\":{\"type\":\"string\",\"description\":\"Thẻ loại sản phẩm của Instagram dành cho bài đăng.\"},\"original_width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của tệp media gốc tính bằng pixel.\"},\"original_height\":{\"type\":\"integer\",\"description\":\"Chiều cao của tệp media gốc tính bằng pixel.\"},\"caption\":{\"type\":\"object\",\"description\":\"Dữ liệu chú thích cho bài đăng.\",\"properties\":{\"text\":{\"type\":\"string\",\"description\":\"Văn bản ghi chú của bài đăng.\"},\"created_at\":{\"type\":\"integer\",\"description\":\"Thời gian tạo chú thích dưới dạng thời gian Unix tính bằng giây.\"},\"user_id\":{\"type\":\"string\",\"description\":\"ID của tác giả chú thích trên Instagram, được trả về dưới dạng văn bản.\"}}},\"user\":{\"type\":\"object\",\"description\":\"Thông tin về tác giả công khai được gắn với bài đăng này.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Thông tin nhận diện người dùng Instagram được trả về dưới dạng văn bản.\"},\"username\":{\"type\":\"string\",\"description\":\"Tên người dùng Instagram.\"},\"full_name\":{\"type\":\"string\",\"description\":\"Tên hiển thị của hồ sơ.\"},\"is_verified\":{\"type\":\"boolean\",\"description\":\"Liệu Instagram có đánh dấu tài khoản này là đã được xác thực hay không.\"}}},\"like_count\":{\"type\":\"integer\",\"description\":\"Số lượt like được báo cáo cho bài đăng.\"},\"comment_count\":{\"type\":\"integer\",\"description\":\"Số lượt bình luận được báo cáo cho bài đăng.\"},\"play_count\":{\"type\":\"integer\",\"description\":\"Số lần phát video được báo cáo khi có sẵn.\"},\"image_versions\":{\"type\":\"object\",\"description\":\"Hình ảnh hoặc phiên bản xem trước của bài đăng.\",\"properties\":{\"items\":{\"type\":\"array\",\"description\":\"Các phiên bản hình ảnh được báo cáo cho mục media này.\",\"items\":{\"type\":\"object\",\"description\":\"Một phiên bản hình ảnh.\",\"properties\":{\"width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của phiên bản hình ảnh tính bằng pixel.\"},\"height\":{\"type\":\"integer\",\"description\":\"Chiều cao của phiên bản hình ảnh tính bằng pixel.\"},\"url\":{\"type\":\"string\",\"description\":\"URL của phiên bản hình ảnh.\"}}}}}},\"video_duration\":{\"type\":\"number\",\"description\":\"Giá trị thời lượng video được báo cáo bởi Instagram.\"},\"video_versions\":{\"type\":\"array\",\"description\":\"Các phiên bản video khi có sẵn.\",\"items\":{\"type\":\"object\",\"description\":\"Một phiên bản video.\",\"properties\":{\"width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của phiên bản video trong pixel.\"},\"height\":{\"type\":\"integer\",\"description\":\"Chiều cao của phiên bản video trong pixel.\"},\"type\":{\"type\":\"integer\",\"description\":\"Mã loại phiên bản video được báo cáo bởi Instagram.\"},\"url\":{\"type\":\"string\",\"description\":\"URL của phiên bản video.\"},\"id\":{\"type\":\"string\",\"description\":\"Định danh của phiên bản video này, được trả về dưới dạng văn bản.\"}}}},\"carousel_media_count\":{\"type\":\"integer\",\"description\":\"Số lượng mục trong carousel được Instagram báo cáo.\"},\"carousel_media\":{\"type\":\"array\",\"description\":\"Các mục truyền thông trong carousel khi được trả về.\",\"items\":{\"type\":\"object\",\"description\":\"Một hình ảnh hoặc video con trong carousel.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ID truyền thông của mục con trong carousel, được trả về dưới dạng văn bản.\"},\"media_type\":{\"type\":\"integer\",\"description\":\"Mã loại truyền thông của mục con trong carousel.\"},\"original_width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của tệp media gốc tính bằng pixel.\"},\"original_height\":{\"type\":\"integer\",\"description\":\"Chiều cao của tệp media gốc tính bằng pixel.\"},\"image_versions\":{\"type\":\"object\",\"description\":\"Hình ảnh hoặc phiên bản xem trước của mục con trong carousel.\",\"properties\":{\"items\":{\"type\":\"array\",\"description\":\"Các phiên bản hình ảnh được báo cáo cho mục media này.\",\"items\":{\"type\":\"object\",\"description\":\"Một phiên bản hình ảnh.\",\"properties\":{\"width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của phiên bản hình ảnh tính bằng pixel.\"},\"height\":{\"type\":\"integer\",\"description\":\"Chiều cao của phiên bản hình ảnh tính bằng pixel.\"},\"url\":{\"type\":\"string\",\"description\":\"URL của phiên bản hình ảnh.\"}}}}}},\"video_duration\":{\"type\":\"number\",\"description\":\"Giá trị thời lượng video được báo cáo bởi Instagram.\"},\"video_versions\":{\"type\":\"array\",\"description\":\"Các phiên bản video khi có sẵn.\",\"items\":{\"type\":\"object\",\"description\":\"Một phiên bản video.\",\"properties\":{\"width\":{\"type\":\"integer\",\"description\":\"Chiều rộng của phiên bản video trong pixel.\"},\"height\":{\"type\":\"integer\",\"description\":\"Chiều cao của phiên bản video trong pixel.\"},\"type\":{\"type\":\"integer\",\"description\":\"Mã loại phiên bản video được báo cáo bởi Instagram.\"},\"url\":{\"type\":\"string\",\"description\":\"URL của phiên bản video.\"}}}}}}}}}},\"user\":{\"type\":\"object\",\"description\":\"Hồ sơ Instagram được trả về cho trang bài viết này.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Thông tin nhận diện người dùng Instagram được trả về dưới dạng văn bản.\"},\"username\":{\"type\":\"string\",\"description\":\"Tên người dùng Instagram.\"},\"full_name\":{\"type\":\"string\",\"description\":\"Tên hiển thị của hồ sơ.\"},\"is_verified\":{\"type\":\"boolean\",\"description\":\"Liệu Instagram có đánh dấu tài khoản này là đã được xác thực hay không.\"},\"profile_pic_url\":{\"type\":\"string\",\"description\":\"URL hình ảnh hồ sơ.\"}}}}},\"pagination_token\":{\"type\":\"string\",\"description\":\"Tên gọi tiếp theo khi có giá trị, được truyền không thay đổi dưới dạng `paginationToken` cho cùng một `username`.\"},\"status\":{\"type\":\"boolean\",\"description\":\"Trạng thái truy vấn nội bộ khi được cung cấp. Giá trị `false` cho biết việc truy vấn bài viết đã thất bại, ngay cả khi mã doanh nghiệp bên ngoài là 0.\"},\"errorMessage\":{\"type\":\"string\",\"description\":\"Thông báo lỗi khi truy vấn bài viết được cung cấp.\"}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Các tham số hoặc nội dung yêu cầu không hợp lệ.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Tài khoản truy cập không hợp lệ hoặc không hoạt động.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Quyền truy cập bị từ chối.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Tốc độ yêu cầu hoặc giới hạn hàng ngày đã vượt quá.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Lỗi máy chủ nội bộ.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Dịch vụ tạm thời không khả dụng.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"API sản xuất toàn cục (mặc định)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/instagram/get-user-posts/v1\"")' />

<p>Lấy thông tin về các bài đăng được đăng bởi người dùng Instagram với chức năng phân trang dựa trên token. Sử dụng để xem qua lịch sử bài đăng của tài khoản đã biết hoặc tiếp tục trên các trang kết quả tiếp theo.</p>

## Tham số

<div class="api-doc-table api-doc-table--params">

| Tên | Vị trí | Kiểu dữ liệu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Đúng | - | Token truy cập cho dịch vụ API. |
| <code>username</code> | query | <code>string</code> | Đúng | - | Tên tài khoản Instagram mà các bài đăng đã được công bố cần được lấy lại. |
| <code>paginationToken</code> | query | <code>string</code> | Không | <code></code> | Token dùng để lấy kết quả trang tiếp theo. |

</div>

## Ví dụ mã hóa

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE'
```

```text [🤖 Lời hướng dẫn AI]
Tôi muốn sử dụng API "Bài đăng đã được công bố của người dùng (V1)" từ JustOneAPI.
URL cơ sở: https://api.justoneapi.com.
Đường dẫn API: /api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE
Điểm cuối API: BASE_URL + /api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE
Phương thức HTTP: GET
Xác thực: Thêm tham số "token" vào URL.
Định nghĩa OpenAPI: https://docs.justoneapi.com/openapi/instagram/user-published-posts-v1-vi.json

Tham số:
- token (query): Token truy cập cho dịch vụ API. (Bắt buộc)
- username (query): Tên tài khoản Instagram mà các bài đăng đã được công bố cần được lấy lại. (Bắt buộc)
- paginationToken (query): Token dùng để lấy kết quả trang tiếp theo.

Định dạng trả về: Xử lý an toàn phản hồi JSON hoặc văn bản dựa trên Content-Type thực tế.

Xử lý phản hồi và mã lỗi:
1. Đọc kết quả xử lý từ trường "code" trong nội dung phản hồi (mã 0 là thành công).
2. Thời gian chờ đề xuất: 120 giây. Nếu 120 giây quá dài, hãy dành ít nhất 60 giây. Một số yêu cầu có thể hết thời gian chờ trước khi có kết quả.
3. Mã kết quả:
   - 0: Thành công
   - 100: Token không hợp lệ hoặc đã bị vô hiệu hóa
   - 301: Không lấy được dữ liệu. Hãy thử lại.
   - 302: Vượt giới hạn tần suất gọi
   - 303: Vượt hạn mức trong ngày
   - 400: Tham số không hợp lệ
   - 500: Lỗi nội bộ máy chủ
   - 600: Không có quyền truy cập
   - 601: Không đủ số dư
   - 602: Đã chạm giới hạn ngân sách token
4. Mã 601 nghĩa là số dư dùng chung của tài khoản không đủ. Mã 602 nghĩa là token API đã chạm giới hạn ngân sách tích lũy riêng. Việc đặt ngân sách cho token không chuyển tiền khỏi số dư dùng chung.

Xin hãy giúp tôi viết một script bằng ngôn ngữ lập trình yêu thích để gọi API này và xử lý phản hồi.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Được cung cấp bởi các server OpenAPI

url = BASE_URL + "/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Được cung cấp bởi các server OpenAPI
const url = BASE_URL + "/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Được cung cấp bởi các server OpenAPI
        final String url = BASE_URL + "/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Được cung cấp bởi các server OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/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()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Được cung cấp bởi các server OpenAPI
$url = $BASE_URL . '/api/instagram/get-user-posts/v1?token=YOUR_API_KEY&username=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/instagram/user-published-posts-v1-vi.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[Định nghĩa OpenAPI (JSON)]</a>
</div>

## Các trường trong phản hồi

Các trường chính trong phản hồi thành công (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Đường dẫn trường | Kiểu dữ liệu | Mô tả |
| --- | --- | --- |
| <code>data</code> | <code>object &#124; null</code> | Kết quả tìm kiếm bài đăng Instagram, có thể chứa trang bài đăng hoặc trạng thái truy vấn cùng thông báo lỗi. |
| <code>data.data</code> | <code>object</code> | Trang bài đăng được trả về khi tìm kiếm cung cấp một trang bài đăng. |
| <code>data.data.count</code> | <code>integer</code> | Số bài đăng của trang theo dữ liệu được báo cáo. |
| <code>data.data.items</code> | <code>array</code> | Các bài đăng Instagram trên trang hiện tại. |
| <code>data.data.items[]</code> | <code>object</code> | Một bài đăng Instagram. |
| <code>data.data.items[].id</code> | <code>string</code> | ID truyền thông Instagram cho bài đăng, được trả về dưới dạng văn bản. |
| <code>data.data.items[].code</code> | <code>string</code> | Mã ngắn của Instagram dành cho bài đăng. |
| <code>data.data.items[].taken_at</code> | <code>integer</code> | Thời điểm bài đăng dưới dạng thời gian Unix tính bằng giây. |
| <code>data.data.items[].media_type</code> | <code>integer</code> | Mã loại tệp media của Instagram. Các mã được chú ý bao gồm 1 cho hình ảnh, 2 cho video, và 8 cho carousel. |
| <code>data.data.items[].product_type</code> | <code>string</code> | Thẻ loại sản phẩm của Instagram dành cho bài đăng. |
| <code>data.data.items[].original_width</code> | <code>integer</code> | Chiều rộng của tệp media gốc tính bằng pixel. |
| <code>data.data.items[].original_height</code> | <code>integer</code> | Chiều cao của tệp media gốc tính bằng pixel. |
| <code>data.data.items[].caption</code> | <code>object</code> | Dữ liệu chú thích cho bài đăng. |
| <code>data.data.items[].caption.text</code> | <code>string</code> | Văn bản ghi chú của bài đăng. |
| <code>data.data.items[].caption.created_at</code> | <code>integer</code> | Thời gian tạo chú thích dưới dạng thời gian Unix tính bằng giây. |
| <code>data.data.items[].caption.user_id</code> | <code>string</code> | ID của tác giả chú thích trên Instagram, được trả về dưới dạng văn bản. |
| <code>data.data.items[].user</code> | <code>object</code> | Thông tin về tác giả công khai được gắn với bài đăng này. |
| <code>data.data.items[].user.id</code> | <code>string</code> | Thông tin nhận diện người dùng Instagram được trả về dưới dạng văn bản. |
| <code>data.data.items[].user.username</code> | <code>string</code> | Tên người dùng Instagram. |
| <code>data.data.items[].user.full_name</code> | <code>string</code> | Tên hiển thị của hồ sơ. |
| <code>data.data.items[].user.is_verified</code> | <code>boolean</code> | Liệu Instagram có đánh dấu tài khoản này là đã được xác thực hay không. |
| <code>data.data.items[].like_count</code> | <code>integer</code> | Số lượt like được báo cáo cho bài đăng. |
| <code>data.data.items[].comment_count</code> | <code>integer</code> | Số lượt bình luận được báo cáo cho bài đăng. |
| <code>data.data.items[].play_count</code> | <code>integer</code> | Số lần phát video được báo cáo khi có sẵn. |
| <code>data.data.items[].image_versions</code> | <code>object</code> | Hình ảnh hoặc phiên bản xem trước của bài đăng. |
| <code>data.data.items[].image_versions.items</code> | <code>array</code> | Các phiên bản hình ảnh được báo cáo cho mục media này. |
| <code>data.data.items[].image_versions.items[]</code> | <code>object</code> | Một phiên bản hình ảnh. |
| <code>data.data.items[].image_versions.items[].width</code> | <code>integer</code> | Chiều rộng của phiên bản hình ảnh tính bằng pixel. |
| <code>data.data.items[].image_versions.items[].height</code> | <code>integer</code> | Chiều cao của phiên bản hình ảnh tính bằng pixel. |
| <code>data.data.items[].image_versions.items[].url</code> | <code>string</code> | URL của phiên bản hình ảnh. |
| <code>data.data.items[].video_duration</code> | <code>number</code> | Giá trị thời lượng video được báo cáo bởi Instagram. |
| <code>data.data.items[].video_versions</code> | <code>array</code> | Các phiên bản video khi có sẵn. |
| <code>data.data.items[].video_versions[]</code> | <code>object</code> | Một phiên bản video. |
| <code>data.data.items[].video_versions[].width</code> | <code>integer</code> | Chiều rộng của phiên bản video trong pixel. |
| <code>data.data.items[].video_versions[].height</code> | <code>integer</code> | Chiều cao của phiên bản video trong pixel. |
| <code>data.data.items[].video_versions[].type</code> | <code>integer</code> | Mã loại phiên bản video được báo cáo bởi Instagram. |
| <code>data.data.items[].video_versions[].url</code> | <code>string</code> | URL của phiên bản video. |
| <code>data.data.items[].video_versions[].id</code> | <code>string</code> | Định danh của phiên bản video này, được trả về dưới dạng văn bản. |
| <code>data.data.items[].carousel_media_count</code> | <code>integer</code> | Số lượng mục trong carousel được Instagram báo cáo. |
| <code>data.data.items[].carousel_media</code> | <code>array</code> | Các mục truyền thông trong carousel khi được trả về. |
| <code>data.data.items[].carousel_media[]</code> | <code>object</code> | Một hình ảnh hoặc video con trong carousel. |
| <code>data.data.items[].carousel_media[].id</code> | <code>string</code> | ID truyền thông của mục con trong carousel, được trả về dưới dạng văn bản. |
| <code>data.data.items[].carousel_media[].media_type</code> | <code>integer</code> | Mã loại truyền thông của mục con trong carousel. |
| <code>data.data.items[].carousel_media[].original_width</code> | <code>integer</code> | Chiều rộng của tệp media gốc tính bằng pixel. |
| <code>data.data.items[].carousel_media[].original_height</code> | <code>integer</code> | Chiều cao của tệp media gốc tính bằng pixel. |
| <code>data.data.items[].carousel_media[].image_versions</code> | <code>object</code> | Hình ảnh hoặc phiên bản xem trước của mục con trong carousel. |
| <code>data.data.items[].carousel_media[].image_versions.items</code> | <code>array</code> | Các phiên bản hình ảnh được báo cáo cho mục media này. |
| <code>data.data.items[].carousel_media[].image_versions.items[]</code> | <code>object</code> | Một phiên bản hình ảnh. |
| <code>data.data.items[].carousel_media[].image_versions.items[].width</code> | <code>integer</code> | Chiều rộng của phiên bản hình ảnh tính bằng pixel. |
| <code>data.data.items[].carousel_media[].image_versions.items[].height</code> | <code>integer</code> | Chiều cao của phiên bản hình ảnh tính bằng pixel. |
| <code>data.data.items[].carousel_media[].image_versions.items[].url</code> | <code>string</code> | URL của phiên bản hình ảnh. |
| <code>data.data.items[].carousel_media[].video_duration</code> | <code>number</code> | Giá trị thời lượng video được báo cáo bởi Instagram. |
| <code>data.data.items[].carousel_media[].video_versions</code> | <code>array</code> | Các phiên bản video khi có sẵn. |
| <code>data.data.items[].carousel_media[].video_versions[]</code> | <code>object</code> | Một phiên bản video. |
| <code>data.data.items[].carousel_media[].video_versions[].width</code> | <code>integer</code> | Chiều rộng của phiên bản video trong pixel. |
| <code>data.data.items[].carousel_media[].video_versions[].height</code> | <code>integer</code> | Chiều cao của phiên bản video trong pixel. |
| <code>data.data.items[].carousel_media[].video_versions[].type</code> | <code>integer</code> | Mã loại phiên bản video được báo cáo bởi Instagram. |
| <code>data.data.items[].carousel_media[].video_versions[].url</code> | <code>string</code> | URL của phiên bản video. |
| <code>data.data.user</code> | <code>object</code> | Hồ sơ Instagram được trả về cho trang bài viết này. |
| <code>data.data.user.id</code> | <code>string</code> | Thông tin nhận diện người dùng Instagram được trả về dưới dạng văn bản. |
| <code>data.data.user.username</code> | <code>string</code> | Tên người dùng Instagram. |
| <code>data.data.user.full_name</code> | <code>string</code> | Tên hiển thị của hồ sơ. |
| <code>data.data.user.is_verified</code> | <code>boolean</code> | Liệu Instagram có đánh dấu tài khoản này là đã được xác thực hay không. |
| <code>data.data.user.profile_pic_url</code> | <code>string</code> | URL hình ảnh hồ sơ. |
| <code>data.pagination_token</code> | <code>string</code> | Tên gọi tiếp theo khi có giá trị, được truyền không thay đổi dưới dạng <code>paginationToken</code> cho cùng một <code>username</code>. |
| <code>data.status</code> | <code>boolean</code> | Trạng thái truy vấn nội bộ khi được cung cấp. Giá trị <code>false</code> cho biết việc truy vấn bài viết đã thất bại, ngay cả khi mã doanh nghiệp bên ngoài là 0. |
| <code>data.errorMessage</code> | <code>string</code> | Thông báo lỗi khi truy vấn bài viết được cung cấp. |

</div>

## Ví dụ phản hồi

<ApiExampleSection :api='JSON.parse("\"/api/instagram/get-user-posts/v1\"")' />

