Releases: justoneapi/justoneapi-python
v2.0.1
Full Changelog: v2.0.0...v2.0.1
Version 2.0.0
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_pageis no longer returnedsuccessis nowTrueonly whencode == 0- Minimum supported Python version is now
3.10+
Response Shape
Every API method now returns an ApiResponse object with the following fields:
successcodemessagedataraw_json
Where:
successisTrueonly whencode == 0datacontains the business payload returned by the APIraw_jsoncontains 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 justoneapiRelated Links
- Website: https://justoneapi.com
- API Documentation: https://docs.justoneapi.com/en
- Get API Token: https://dashboard.justoneapi.com/en/register
- Contact Us: https://justoneapi.com/en/contact
中文
Just One API Python SDK 2.0.0
2.0.0 是一次重要版本升级。这个版本对 Python SDK 做了全面重构,整体调用体验和返回结构都更加统一,也更适合长期维护和持续迭代。
如果你正在从 1.x 升级,建议先阅读下面的兼容性变更说明。
本次更新
- SDK 进行了整体重构
- 主入口仍然是
JustOneAPIClient - 所有接口统一返回
ApiResponse - 统一的异常模型,支持业务异常和传输异常分层处理
- 返回结构更清晰,便于调用方统一判断
success、code、message和data
兼容性变更
- 返回值由旧版 tuple 改为
ApiResponse - 不再返回
has_next_page success的判定规则调整为:只有code == 0才算成功- 最低 Python 版本要求提升为
3.10+
返回结构
每个 API 方法现在都会返回一个 ApiResponse 对象,包含以下字段:
successcodemessagedataraw_json
其中:
success仅当code == 0时为Truedata为接口返回的业务数据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
🚀 Release Notes
✨ New Features
- TikTok API
- Added new API endpoints:
/api/toutiao/*
- Added new API endpoints:
Version 1.15.2
Add taobao.get_item_comment_v1
Version 1.15.1
Update Taobao API.
Version 1.15.0
🚀 Release Notes
✨ New Features
- TikTok API
- Added some new API endpoints:
/api/tiktok/*
- Added some new API endpoints:
Version 1.14.0
🚀 Release Notes
✨ New Features
- jd.com API
- Added a new API endpoint:
/api/jd/get-item-detail/v1
- Added a new API endpoint:
Version 1.13.0
Added several new Weibo APIs.
Version 1.12.0
Added several new Xiaohongshu APIs.
Version 1.11.0
Added several new Taobao APIs.