Skip to main content

Minimal Python client for the EUIPO trademark search API

Project description

euipo-tm-client

Minimal Python client for the EUIPO (European Union Intellectual Property Office) trademark search API.

It is a thin, synchronous wrapper (built on httpx) that handles OAuth2 authentication and returns responses as raw parsed JSON (dict). It covers the two core endpoints: searching for trade marks and retrieving the details of a single trade mark.

Installation

pip install euipo-tm-client

Configuration

The client reads credentials from environment variables (you can keep them in a .env file in the working directory — real environment variables take precedence):

Variable Description
EUIPO_API_KEY Your application's client ID
EUIPO_API_SECRET Your application's client secret
EUIPO_ENVIRONMENT "sandbox" (default) or "production"

Obtain credentials and subscribe your application to the Trademark search API plan via the EUIPO developer portal.

Usage

from euipo_tm_client import TrademarkSearchClient

with TrademarkSearchClient() as client:
    # Search using an RSQL query expression.
    results = client.search_trademarks(
        query="wordMarkSpecification.verbalElement==apple",
        size=10,
    )
    print(results["totalElements"])
    for tm in results["trademarks"]:
        print(tm["applicationNumber"], tm.get("status"))

    # Retrieve full details for one trade mark.
    detail = client.get_trademark("018692868", language="en")
    print(detail["status"])

Credentials and environment can also be passed explicitly instead of via the environment:

client = TrademarkSearchClient(
    api_key="...", api_secret="...", environment="production",
)

Errors

API and authentication failures raise typed exceptions, all subclasses of EUIPOError:

  • EUIPOAuthError — token acquisition failed.
  • EUIPOAPIError — the API returned a non-2xx response; exposes .status_code and the parsed .body.

Query language (RSQL)

The query argument of search_trademarks() accepts an RSQL (REST Query Language) expression — a compact, URL-friendly filter syntax. A clause is field + operator + value, and clauses combine with and / or (use parentheses to group). RSQL avoids unsafe characters, so no URL encoding is needed.

Comparison operators:

Operator Meaning
== equal to (supports * as a wildcard)
!= not equal to (supports * as a wildcard)
< <= > >= range comparison (dates and numbers)
=in= in a set, e.g. =in=(WORD,FIGURATIVE)
=out= not in a set
=all= contains all of a set

Each field supports only a subset of these operators. Date fields (applicationDate, registrationDate, expiryDate, …) expect yyyy-MM-dd values. Examples:

# Verbal element exactly "apple"
wordMarkSpecification.verbalElement==apple

# Wildcard match + status, with nice-class membership
niceClasses=all=(25,28,40) and wordMarkSpecification.verbalElement==*Dog* and status==REGISTERED

# Date range with grouped OR logic
applicationDate>=2023-05-04 and ((markFeature==FIGURATIVE and niceClasses=all=(25,26)) or (markFeature==WORD and niceClasses=out=(40)))

The full grammar, the list of supported fields, and the operators each field allows are documented in the query parameter of the OpenAPI spec (specs/openapi.json).

Development

This project is managed with uv.

uv sync          # install dependencies
uv run pytest    # run the test suite (mocks HTTP; no live credentials needed)
uv run main.py   # run the live sandbox demo (requires credentials)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

euipo_tm_client-0.1.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

euipo_tm_client-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file euipo_tm_client-0.1.0.tar.gz.

File metadata

  • Download URL: euipo_tm_client-0.1.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for euipo_tm_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fad73d61cbd2df591bf1a9a3c55b4bf8542f26430d20446a2199f0e6d8e439e
MD5 01887318cdfcbaf353c94129d34844f1
BLAKE2b-256 c2a880c38f76504d867280d976dd2459d7449d362f772914c4502b26b28329ba

See more details on using hashes here.

File details

Details for the file euipo_tm_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for euipo_tm_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09b5c6048871f5e357e7fc90023a54084da671588fbe1fe5c7b1c744172da2ac
MD5 7105ca0d0ccfc72714153e8402d1ab12
BLAKE2b-256 fee44c3209b16f8660d0817b674a84691c7ec7249c7b9216d23a0e4c11bfe1f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page