subjectIdstringbắt buộc
The unique ID for a movie or TV subject on Douban.
https://api.sandbase.ai/v1/api/douban/movie-commentsShort comments (one-line reviews) on a Douban movie or TV subject with rating, user and location, sorted by time or score.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Returns short one-line comments for a Douban movie or TV subject. Each comment includes the text, the user's rating label, the user name and a location. The API needs the Douban subjectId.
subjectId 1292052 for sentiment analysis.sort between time and new_score.location to see which Chinese regions discuss a title.curl -X POST "https://api.sandbase.ai/v1/api/douban/movie-comments" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subjectId": "1292052"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
subjectId | string | Yes | The unique ID for a movie or TV subject on Douban. |
page | integer | No | Page number for pagination. |
sort | string | No | Sort order for the result set. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"comments": [
{
"avatar": "https://img3.doubanio.com/icon/u210199036-3.webp",
"cid": "4980937286",
"content": "牢狱困得住躯体,困不住希望。安迪以漫长时光守住内心,告诉我们自由从不在高墙之外,而永不熄灭的信念本身就是救赎。",
"location": "安徽",
"rating": "推荐",
"time": "",
"username": "大喊一声啦啦啦",
"vote_count": 0
}
]
}
| Field | Meaning |
|---|---|
comments[] | List of short comments on the subject. Each item is one comment. |
comments[].cid | ID of the comment, returned as a string. |
comments[].content | Text of the short comment. |
comments[].rating | Rating label the user gave, such as 推荐 or 力荐. It is a text label, not a number. |
comments[].username | Display name of the user who wrote the comment. |
comments[].avatar | URL of the user's avatar image. |
comments[].location | Location shown for the user, such as a province name. |
comments[].vote_count | Number of votes the comment received. |
comments[].time | Time field of the comment. It was an empty string in the sample response. |
subjectId with Douban Recent Hot Movie or Douban Recent Hot Tv. Use Douban Subject Details for the title's own data.sort accepts time (default) or new_score. Use page to get more comments, starting at 1.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/douban/movie-comments" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"sort": "time",
"subjectId": "1292052"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
subjectIdstringbắt buộcThe unique ID for a movie or TV subject on Douban.
sortstringSort order for the result set.
Mặc định: "time"
Giá trị có thể dùng: time, new_score
pageintegerPage number for pagination.
Mặc định: 1
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Douban Movie Short CommentsAPI này Douban | $0.014286 mỗi lần gọi | JSON |
Douban | $0.014286 mỗi lần gọi | JSON |
Douban | $0.014286 mỗi lần gọi | JSON |
Douban | $0.014286 mỗi lần gọi | JSON |
Douban | $0.014286 mỗi lần gọi | JSON |
Douban | $0.014286 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/douban/movie-comments với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
$0.014286 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: subjectId (string). Tùy chọn: sort (một trong số time, new_score) và page (integer). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Douban Movie Short Comments chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Douban.