DD

devnorsai/devnors-data-python

Developer tools
124 stars 0 forks 품질 35 트렌드 35

Use Devnors Data from Python with one API Key.

개요

Use Devnors Data from Python with one API Key.

README

Devnors Data Python SDK

简体中文 | English

Use Devnors Data from Python with one API Key.

Call legal cases, laws, enterprise data, content indexes, academic research (papers / patents / journals / scholars), express tracking, and more through a single POST /v1/data/query gateway. Every hit is designed for AI agents, with official-source traceability where applicable.

Install

pip install devnors-data

Quick Start

Create an API Key in the developer console, then:

from devnors_data import DevnorsData

client = DevnorsData(api_key="devnors_sk_live_xxx")  # or set DEVNORS_API_KEY

# Legal judgment documents
res = client.legal_cases("民间借贷 利息", top_k=10)
for hit in res["hits"]:
    print(hit.get("case_no"), hit.get("title"))

# Law articles
laws = client.legal_laws("合同解除 违约金")

# Unified entry for any domain / type
res = client.query(domain="legal", type="case", query="劳动争议", top_k=5)
print(res["units"], "tokens used")

Async:

import asyncio
from devnors_data import AsyncDevnorsData

async def main():
    client = AsyncDevnorsData(api_key="devnors_sk_live_xxx")
    res = await client.legal_cases("交通事故 责任认定")
    print(res["total_hits"])

asyncio.run(main())

Token

Use your Devnors Data API Key in one of these ways:

DevnorsData(api_key="devnors_sk_live_xxx")

or:

DEVNORS_API_KEY=devnors_sk_live_xxx

Optional private / self-hosted base URL:

DEVNORS_DATA_BASE_URL=https://data.devnors.com

Things You Can Do

Search Chinese legal judgment documents for private lending disputes.
Look up current PRC law articles about contract termination and liquidated damages.
Query company registration details with a credit code or company name.
Check whether a company is on the dishonest judgment debtor list.
Get Weibo or Douyin hot-rank items for today.
Track a parcel with company code and tracking number.
Search academic papers, patents, journals, or scholars, then fetch a detail by ID.
Paginate legal case hits until I have 100 results.

Retry and Pagination

  • Automatic retry for 429 / 5xx / connection errors (bounded exponential backoff). Non-retryable errors such as 400 / 401 / 402 / 501 are never retried. Disable with DevnorsData(..., max_retries=0).
  • Pagination helper: paginate(...) walks pages using total_hits.
for hit in client.paginate("legal", "case", "借贷纠纷", page_size=20, max_items=100):
    print(hit.get("case_no"))

Billing and Errors

  • Successful calls return units (tokens charged) and request_id.
  • Insufficient balance raises DevnorsDataError(code="insufficient_balance", status=402).
  • Rate limit raises code="rate_limited" (429).
  • Each DevnorsDataError includes code / retryable / next_action / request_id.

Data Domains

domain type status
legal case / law_article / law_catalog live
content keyword_index / suggest_list / keyword_word / wechat_index_v2 / hot_rank live
enterprise company_detail_v2 / annual_report_list / annual_report_detail / account_open / company_tag / same_legal_company / key_person / shareholder / branch_org / industrial_commercial_change / taxpayer_basic / tax_credit_level / tax_illegal / tax_illegal_major / tax_illegal_major_detail / operation_except / admin_punishment / judgment_list / court_notice_list / court_trial_list / cases_info_list / termination_case_list / serious_illegal / exec_person / breach_of_trust / listed_company / listed_company_neeq live
cloud express / express_com / web_search / invoice_ocr live
research paper_search / patent_search / journal_search / paper_detail / patent_detail / journal_detail / scholar_search / scholar_detail live

Docs: https://data.devnors.com/docs

License

MIT

View this README on GitHub

설치

This server does not publish a one-line install command.

Open the repository installation guide