Skip to content

Releases: justoneapi/justoneapi-python

v2.0.1

29 Mar 15:39

Choose a tag to compare

Version 2.0.0

29 Mar 14:59

Choose a tag to compare

English

Just One API Python SDK 2.0.0

2.0.0 is a major upgrade for the Python SDK. This release includes a full SDK refactor with a more consistent calling experience, a clearer response structure, and a better foundation for long-term maintenance.

If you are upgrading from 1.x, review the compatibility changes below before migrating.

What's New

  • The SDK has been fully refactored
  • The main entry point remains JustOneAPIClient
  • All API methods now return ApiResponse
  • A unified exception model is provided for business errors and transport/protocol errors
  • The response structure is clearer and easier to handle consistently across endpoints

Breaking Changes

  • Return values changed from tuples to ApiResponse
  • has_next_page is no longer returned
  • success is now True only when code == 0
  • Minimum supported Python version is now 3.10+

Response Shape

Every API method now returns an ApiResponse object with the following fields:

  • success
  • code
  • message
  • data
  • raw_json

Where:

  • success is True only when code == 0
  • data contains the business payload returned by the API
  • raw_json contains the original response body for debugging and inspection

Upgrade Example

Old usage:

result, data, message = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

New usage:

response = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

print(response.success)
print(response.code)
print(response.message)
print(response.data)

If you prefer business failures to raise exceptions:

from justoneapi import JustOneAPIClient, BusinessError

client = JustOneAPIClient(
    token="your_token",
    raise_on_business_error=True,
)

try:
    response = client.douyin.search_video_v4(keyword="deepseek")
except BusinessError as exc:
    print(exc.response.code)
    print(exc.response.message)

Installation

pip install -U justoneapi

Related Links


中文

Just One API Python SDK 2.0.0

2.0.0 是一次重要版本升级。这个版本对 Python SDK 做了全面重构,整体调用体验和返回结构都更加统一,也更适合长期维护和持续迭代。

如果你正在从 1.x 升级,建议先阅读下面的兼容性变更说明。

本次更新

  • SDK 进行了整体重构
  • 主入口仍然是 JustOneAPIClient
  • 所有接口统一返回 ApiResponse
  • 统一的异常模型,支持业务异常和传输异常分层处理
  • 返回结构更清晰,便于调用方统一判断 successcodemessagedata

兼容性变更

  • 返回值由旧版 tuple 改为 ApiResponse
  • 不再返回 has_next_page
  • success 的判定规则调整为:只有 code == 0 才算成功
  • 最低 Python 版本要求提升为 3.10+

返回结构

每个 API 方法现在都会返回一个 ApiResponse 对象,包含以下字段:

  • success
  • code
  • message
  • data
  • raw_json

其中:

  • success 仅当 code == 0 时为 True
  • data 为接口返回的业务数据
  • raw_json 为原始响应内容,便于排查问题

升级示例

旧版调用方式:

result, data, message = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

新版调用方式:

response = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

print(response.success)
print(response.code)
print(response.message)
print(response.data)

如果你希望业务失败时直接抛异常:

from justoneapi import JustOneAPIClient, BusinessError

client = JustOneAPIClient(
    token="your_token",
    raise_on_business_error=True,
)

try:
    response = client.douyin.search_video_v4(keyword="deepseek")
except BusinessError as exc:
    print(exc.response.code)
    print(exc.response.message)

安装

pip install -U justoneapi

相关链接

Version 1.16.0

01 Jan 01:56

Choose a tag to compare

🚀 Release Notes

✨ New Features

  • TikTok API
    • Added new API endpoints: /api/toutiao/*

Version 1.15.2

11 Dec 08:28

Choose a tag to compare

Add taobao.get_item_comment_v1

Version 1.15.1

02 Dec 06:26

Choose a tag to compare

Update Taobao API.

Version 1.15.0

29 Oct 08:21

Choose a tag to compare

🚀 Release Notes

✨ New Features

  • TikTok API
    • Added some new API endpoints: /api/tiktok/*

Version 1.14.0

24 Oct 09:57

Choose a tag to compare

🚀 Release Notes

✨ New Features

  • jd.com API
    • Added a new API endpoint: /api/jd/get-item-detail/v1

Version 1.13.0

26 Sep 09:48

Choose a tag to compare

Added several new Weibo APIs.

Version 1.12.0

14 Sep 15:08

Choose a tag to compare

Added several new Xiaohongshu APIs.

Version 1.11.0

04 Sep 10:53

Choose a tag to compare

Added several new Taobao APIs.