China Trademark API to CSV

Export company-associated Chinese trademark records to an internal CSV with the search identity, original status, observation date, and clear coverage.

ArticlesPublished by ChinaValidatePublished December 3, 2026Last updated December 3, 2026

Retrieve trademark records associated with a Chinese company.

View API documentationAPI workspace
China Trademark API to CSV

A reviewer looks up trademarks associated with a Chinese supplier and wants a file a colleague can filter offline. The export needs to explain which Chinese company was queried, when the response was collected, and what the returned status describes. If the file contains only a list of translated names and a red or green label, it cannot tell the next reviewer which search it came from or what evidence was available.

Create the CSV in your own integration from a saved response to the ChinaValidate Trademarks API. Retain the observed name, type and status where returned. Put the query company and observation reference on the same row, together with an identifier from the item if your response actually provides one. Keep the raw source under authorized access. Configure this export for internal review consistent with the service terms. ChinaValidate Trademarks API · ChinaValidate terms of service

Record the request that produced the export

The endpoint is queried by exact Chinese legal company name, with an optional response language. If you start with a Unified Social Credit Code, the company profile operation can help confirm the legal name to send. Keep the code and the checked name in the lookup record. A familiar brand is useful for comparing items inside the result, but the endpoint's company query does not ask for a brand-name search. Store both values if someone needs to see why a record was selected. Company profile lookup

The trademark response documents a total count and a set of returned items in data. Its core example includes the brand name, recorded type and status. Some records can carry additional details. The export should keep exact registered or application numbers as strings when the response actually has them, rather than filling a missing number from a similarly named item. A reviewer may obtain additional evidence directly from a national register, using the terms and identifiers accepted by that register. China’s National Intellectual Property Administration describes announcement searches by trademark name, applicant, and registration or announcement information. CNIPA trademark announcement query

Decide what the export covers before naming the file. An export for a single completed response is a snapshot of what came back, at the time it was collected. The documented total can be greater than the number of returned items. Keep both numbers in a header, sidecar or review list. Do not describe the file as a complete portfolio merely because the API returned successfully. If a record is material to a decision and it is absent from the returned set, retain that uncertainty and use the relevant official lookup with the information you have.

Columns that survive handoff

A CSV row for a trademark should be understandable when it is separated from the original spreadsheet. Include the observation time, queried Chinese legal name, internal observation reference, original name, original type and original status. If the team uses a language variant, it can include display columns separate from the original values. Tie the display text to the same source item and record requested language. This lets a colleague review a locally understandable name without losing the Chinese search term needed for public evidence.

Some returned display attributes may include punctuation and text that takes up multiple lines. Use a CSV writer to quote these values, rather than constructing a line with commas yourself. The common CSV conventions described in RFC 4180 deal with commas, double quotes and line breaks inside fields. Choose an encoding and document it. UTF-8 can represent the original Chinese and bilingual display values. An Excel-oriented download may need a compatible import method so that numeral-looking identifiers arrive as text. Encoding alone does not control cell type detection. RFC 4180 on CSV · Microsoft guidance on preserving leading zeroes

The script below reads a local file that your application already saved for one lookup. In this example the wrapper contains the original API body in response, along with the original company name, observation time and internal lookup ID. It emits item rows to an internal, spreadsheet-oriented file. An application with a separate collection or download policy can adapt the writer accordingly.

import csv
import json
from pathlib import Path

lookup = json.loads(Path("trademark-observation.json").read_text(encoding="utf-8"))
response = lookup["response"]
if response["code"] != 200:
    raise ValueError("Only completed trademark observations can be exported.")

result = response["data"]
items = result["items"]
if not isinstance(items, list):
    raise ValueError("The observation does not contain an item list.")

def sheet_text(value):
    if value is None:
        return ""
    original = str(value)
    if original.lstrip().startswith(("=", "+", "-", "@")):
        return "'" + original
    return original

columns = [
    "lookup_id", "observed_at", "company_name",
    "trademark_name_original", "type_original", "status_original"
]

with Path("trademark-review.csv").open(
    "w", encoding="utf-8-sig", newline=""
) as output:
    writer = csv.writer(output)
    writer.writerow(columns)
    for item in items:
        values = [
            lookup["lookup_id"], lookup["observed_at"], lookup["company_name"],
            item.get("name"), item.get("type"), item.get("status")
        ]
        writer.writerow(sheet_text(value) for value in values)

print(f"Exported {len(items)} rows; reported total {result['total_count']}.")

The spreadsheet-safe display handling belongs to the export, since spreadsheet software may interpret certain cell values as formula text. The protected source keeps the original value and its original type. Verify the actual software in which reviewers open the file, and use explicit text column imports for identifiers. The small example does not turn a spreadsheet into the only copy of the original record. Printing the count at the end lets the process log an export outcome without sending the full data into operational logs. Python CSV module reference

If colleagues need to filter by a class, store a locally extracted class value in a separate column from the original type text. The value may be absent or have a description beside the number. Make an extraction assumption explicit and allow the normalized value to remain empty. An export that changes the original type just to make spreadsheet sorting easier can hide the exact value the service supplied. A reviewer who narrows the list should also know that a filtered set may omit other rows that the underlying lookup returned.

Empty and incomplete exports

A completed query with no returned records can still have a useful observation. Keep an export record for it with the queried company, recorded date, status and count, even if the item file contains only a heading line. A failed request is a different case. Do not create an empty item export that implies a successful check. Record the application error or transport failure against the attempt and make it clear why item evidence is unavailable.

For an observation with some usable records and some missing optional fields, export what was returned. Use a blank column for values that were unavailable and document how the export represents blanks. In a review table where the difference matters, include a presence marker or provide an authorized reference to the original item. For example, an empty alias may simply be how that field was shown, while an unreturned registration number means the reviewer may need to search the official record using the name and applicant. The CSV header should tell the next reader which facts came from the response and which were added by the reviewer.

Export condition Record to keep
Response returned items and a larger reported total The actual exported row count and the reported total separately
One item is missing its registration number A blank optional identifier and the link to the observation
A reviewed number contains leading zeroes The original string and instructions to import the column as text
A value contains punctuation or newlines The correctly quoted cell, with the source preserved separately
Export uses a display language Original values and the requested language where relevant
No items were returned in a completed lookup A dated empty observation with its company and request reference

A reviewable file for the next person

Test the export on a small authorized fixture containing Chinese text, a quoted name and a multi-line field. Read the file back with the same CSV library to check its shape. Then open it using the intended spreadsheet import process and verify that a numeric-looking identifier with a leading zero remains legible. Test a completed empty result and a request that failed, ensuring the two are distinguishable. Make another request only when a fresh observation is actually required so formatting changes do not cause another paid lookup.

Finally, give a colleague only the permitted review file and access to its evidence reference. They should be able to identify the searched Chinese company, tell which date and count the export represents, and locate the source item behind a questioned row. If the relevant decision requires a current check of transfer, renewal, or registration status, tie that follow-up to an official reference and its date. A useful CSV speeds the handoff while keeping the scope of the original API observation visible.

For a recurring export, keep the export date distinct from the lookup date. Regenerating a file after adjusting column names can use a previous observation and should still carry the older observation time. If a new file contains two successive observations, include both reference IDs and dates in the item rows so the reviewer can filter by the evidence used in a particular decision.