dpmaconnect

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 14 Imported by: 0

README

DPMA Connect Plus Go Client

CI Go Reference Go Report Card

A Go client for the German Patent and Trade Mark Office (DPMA) Connect Plus REST API (DPMAregister web services), covering German patent, design, and trademark data over HTTP Basic authentication.

Overview

  • Three services - patents and utility models, designs, and trademarks, selected with the dpma.ServicePatent, dpma.ServiceDesign, and dpma.ServiceTrademark constants.
  • Expert search - SearchPatents, SearchDesigns, SearchTrademarks using DPMAregister expert search syntax, with optional client-side query validation.
  • Register data - register info by number, register extracts, and searchable full text.
  • Bulk and single downloads - weekly XML/PDF bulk archives, single publication PDFs, and design/trademark images.
  • Streaming variants - every bulk and register-extract method has a *Stream variant that writes to an io.Writer without buffering the whole response.
  • Typed errors - NotFoundError, DataNotAvailableError, APIError, and XMLParseError for errors.As handling.

Installation

go get github.com/patent-dev/dpma-connect-plus

Getting access

DPMAconnectPlus is a contractual data-supply service. The DPMA issues an HTTP Basic username and password after a signed standard agreement is in place; there is no self-service web portal. A one-time connection fee applies (200 EUR at time of writing); data retrieval itself is free.

  1. Review the service and terms on the DPMAconnectPlus page.

  2. Complete the standard agreement (Standardvertrag DPMAconnectPlus) including the purpose-of-use paragraph, and send two signed originals to Deutsches Patent- und Markenamt, Referat 2.1.2 - Kundenservice Datenabgabe, 80297 München, Germany.

  3. The DPMA creates an account with a username and a password of your choice.

  4. Export the credentials for the client and demo:

    export DPMA_CONNECT_PLUS_USERNAME=your-username
    export DPMA_CONNECT_PLUS_PASSWORD=your-password
    

Quick start

package main

import (
    "context"
    "fmt"
    "log"

    dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
    client, err := dpma.NewClient(&dpma.Config{
        Username: "your-dpma-username",
        Password: "your-dpma-password",
    })
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()

    // Get service version
    version, err := client.GetVersion(ctx, dpma.ServicePatent)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Version: %s\n", version)

    // Validate query before sending (optional but recommended)
    if err := dpma.ValidatePatentQuery("TI=Elektrofahrzeug"); err != nil {
        log.Fatal(err)
    }

    // Search patents (uses DPMAregister expert search syntax)
    results, err := client.SearchPatents(ctx, "TI=Elektrofahrzeug")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Results: %d bytes\n", len(results))
}

Usage

All methods accept context.Context for timeout and cancellation support.

Configuration
config := &dpma.Config{
    Username: "your-username",                                    // Required
    Password: "your-password",                                    // Required
    BaseURL:  "https://dpmaconnect.dpma.de/dpmaws/rest-services", // Default
    Timeout:  20 * time.Minute,                                   // Default: 20 minutes
    HTTPClient: myCustomHTTPClient,                               // Optional: your own *http.Client
}

client, err := dpma.NewClient(config)

If HTTPClient is set, Timeout is ignored and the custom client's timeout applies instead.

Common operations
// Get service version
GetVersion(ctx, service string) (string, error)

Use the service constants: dpma.ServicePatent, dpma.ServiceDesign, dpma.ServiceTrademark.

Query validation
// Validate a query against service-specific field codes (returns nil or error)
ValidatePatentQuery(query string) error
ValidateDesignQuery(query string) error
ValidateTrademarkQuery(query string) error

For advanced usage (tokenization, field inspection), use the query sub-package directly:

import "github.com/patent-dev/dpma-connect-plus/query"

// Parse and validate a patent query
q, err := query.ParseQuery("TI=Elektrofahrzeug AND INH=Siemens", query.ServicePatent)
if err != nil {
    log.Fatal(err)
}
if err := q.Validate(); err != nil {
    log.Fatal(err) // e.g. unknown field, unmatched parentheses
}

// Inspect the query
fmt.Println(q.GetFields())    // ["TI", "INH"]
fmt.Println(q.HasField("TI")) // true

// Look up field definitions
f, ok := query.GetField("TI", query.ServicePatent)
fmt.Println(f.Description) // "title / designation"

// List all valid fields for a service
fields := query.GetValidFields(query.ServiceDesign)

The parser supports quoted values, comparison operators (=, >=, <=, >, <), parentheses and curly braces (procedure data), bracket/brace matching, and both English (AND, OR, NOT) and German (UND, ODER, NICHT) Boolean operators. Field validation is per service, based on the official DPMAregister field codes.

Patent service
// Search patents and utility models
SearchPatents(ctx, query string) ([]byte, error)

// Get patent info by registered number
GetPatentInfo(ctx, registeredNumber string) ([]byte, error)

// Get searchable full text for a document
GetSearchableFullText(ctx, documentID string) ([]byte, error)

// Download single patent publication PDF
GetPatentPublicationPDF(ctx, documentID string) ([]byte, error)

// Weekly bulk downloads (XML)
GetDisclosureDocumentsXML(ctx, year, week int) ([]byte, error)
GetPatentSpecificationsXML(ctx, year, week int) ([]byte, error)
GetUtilityModelsXML(ctx, year, week int) ([]byte, error)
GetPublicationDataXML(ctx, year, week int) ([]byte, error)
GetApplicantCitationsXML(ctx, year, week int) ([]byte, error)
GetEuropeanPatentSpecificationsXML(ctx, year, week int) ([]byte, error)

// Weekly bulk downloads (PDF)
GetDisclosureDocumentsPDF(ctx, year, week int) ([]byte, error)
GetPatentSpecificationsPDF(ctx, year, week int) ([]byte, error)
GetEuropeanPatentSpecificationsPDF(ctx, year, week int) ([]byte, error)
GetUtilityModelsPDF(ctx, year, week int) ([]byte, error)

// Register extract
GetPatentRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Design service
// Search designs
SearchDesigns(ctx, query string) ([]byte, error)

// Get design info by design number
GetDesignInfo(ctx, designNumber string) ([]byte, error)

// Get design image/thumbnail
GetDesignImage(ctx, designNumber, imageNumber string) ([]byte, error)
GetDesignThumbnail(ctx, designNumber, thumbnailNumber string) ([]byte, error)

// Weekly bulk downloads
GetDesignBibliographicDataXML(ctx, year, week int) ([]byte, error)
GetDesignImages(ctx, year, week int) ([]byte, error)

// Register extract
GetDesignRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Trademark service
// Search trademarks
SearchTrademarks(ctx, query string) ([]byte, error)

// Get trademark info by application number
GetTrademarkInfo(ctx, applicationNumber string) ([]byte, error)

// Get trademark image/thumbnail
GetTrademarkImage(ctx, applicationNumber string) ([]byte, error)
GetTrademarkThumbnail(ctx, applicationNumber string) ([]byte, error)

// Weekly bulk downloads
GetTrademarkBibDataApplied(ctx, year, week int) ([]byte, error)
GetTrademarkBibDataRegistered(ctx, year, week int) ([]byte, error)
GetTrademarkBibDataRejected(ctx, year, week int) ([]byte, error)

// Register extract
GetTrademarkRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Streaming downloads (memory-efficient)

Every bulk download and register extract method has a *Stream variant that writes to an io.Writer:

file, err := os.Create("patents_202445.zip")
if err != nil {
    log.Fatal(err)
}
defer file.Close()

err = client.GetPatentSpecificationsXMLStream(ctx, 2024, 45, file)
if err != nil {
    log.Fatal(err)
}

The full set of *Stream methods mirrors the buffered bulk and register-extract methods above (GetDisclosureDocumentsXMLStream, GetDesignImagesStream, GetTrademarkRegisterExtractStream, and so on).

Search query syntax

All search methods use DPMAregister expert search syntax. The format is FIELD=value with Boolean operators AND/UND, OR/ODER, NOT/NICHT (English and German are both accepted), comparison operators (=, >=, <=, >, <), wildcards (? any chars, ! one char, # one or no char), quoted values, and parentheses. Procedure-data fields are written inside curly braces, for example {VST=pub-offenlegungsschrift UND VSTT=05.01.2011}.

The query subpackage parses and validates queries against per-service field definitions (see Query validation). Each service supports a different set of field codes; the most common are listed below.

Common patent field codes:

Code Description
TI Bezeichnung/Titel (title / designation)
INH Anmelder/Inhaber (applicant / proprietor)
IN Erfinder (inventor)
IC IPC-Klasse (IPC classification)
AKZ Aktenzeichen (file number / publication number)
PN Veröffentlichungsnummer (publication number)
AT Anmeldetag (filing date)
PUB Publikationstag (publication date)
ST Status
AB Abstract

Common design field codes:

Code Description
TI Bezeichnung/Titel (title / designation)
INH Inhaber (proprietor)
ENTW Entwerfer (designer)
ERZ Erzeugnis(se) (product(s))
WKL Warenklasse (Locarno class)
RN Registernummer (registration number)
DNR Designnummer (design number)
AT Anmeldetag (filing date)
ET Eintragungstag (registration date)

Common trademark field codes:

Code Description
MARKE / md Marke (trademark text)
INH Anmelder/Inhaber (applicant / proprietor)
KL Klasse(n) (Nice class(es))
BKL Bildklasse(n) (Vienna / image class(es))
MF Markenform (trademark form)
RN Registernummer/Aktenzeichen (registration number / file number)
AT Anmeldetag (filing date)
ST Status

For full field references, see the DPMAregister help pages:

Date and week formatting

Publication weeks use YYYYWW format (6 digits); register extracts use YYYY-MM-DD:

pubWeek, err := dpma.FormatPublicationWeek(2024, 45) // "202445", nil
year, week, err := dpma.ParsePublicationWeek("202445") // 2024, 45, nil

date := time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)
dateStr := dpma.FormatDate(date) // "2024-10-23"
Data availability
  • Publication data is updated weekly: patents/utility models on Thursdays, designs/trademarks on Fridays.
  • Register data is updated daily.

DataNotAvailableError is common for future publication weeks, very old weeks (before digital archiving), and weeks with no publications.

Error handling

The library returns typed errors you can match with errors.As:

// Resource not found (404)
var notFoundErr *dpma.NotFoundError
if errors.As(err, &notFoundErr) {
    fmt.Printf("not found: %s %s\n", notFoundErr.Resource, notFoundErr.ID)
}

// Data not available (common for old/future publication weeks)
var dataErr *dpma.DataNotAvailableError
if errors.As(err, &dataErr) {
    fmt.Println("data not available for the requested period")
}

// Generic API errors
var apiErr *dpma.APIError
if errors.As(err, &apiErr) {
    fmt.Printf("API error: %s (code: %s, HTTP %d)\n", apiErr.Message, apiErr.Code, apiErr.StatusCode)
}

// XML parsing failures (malformed response data)
var xmlErr *dpma.XMLParseError
if errors.As(err, &xmlErr) {
    fmt.Printf("failed to parse response in %s: %v\n", xmlErr.Operation, xmlErr.Unwrap())
}

Testing

make test              # unit tests (race), mock HTTP server
make test-integration  # integration tests (//go:build integration), needs credentials
make lint

Integration tests hit the live DPMA API and skip unless credentials are set:

export DPMA_CONNECT_PLUS_USERNAME=your-username
export DPMA_CONNECT_PLUS_PASSWORD=your-password
make test-integration

An interactive demo application is included under demo/; it reads the same environment variables and offers a menu for the patent, design, and trademark services.

Implementation status

Every endpoint of the DPMA Connect Plus API is implemented across the patent, design, and trademark services (see the Usage method lists). How much of that surface a given account can exercise depends on the permissions DPMA grants it.

A subset is covered by the integration test suite and verified against the live API, including GetVersion, the three Search* methods (and their *Parsed variants), GetPatentInfo / GetDesignInfo / GetTrademarkInfo, GetPatentRegisterExtract, GetPatentPublicationPDF, GetDisclosureDocumentsXML, and GetDesignBibliographicDataXML.

The remaining bulk endpoints (for example GetPublicationDataXML, GetApplicantCitationsXML, GetDesignImages, and the GetTrademarkBibData* methods) are implemented but require permissions the test account does not currently hold, so they are not yet exercised end to end.

Development

Regenerate the typed client when the OpenAPI spec (openapi.yaml) changes:

make generate

This re-applies any local OpenAPI fixes and runs go generate ./..., which drives oapi-codegen to rewrite generated/types_gen.go and generated/client_gen.go. Do not edit the files under generated/ by hand.

Other common targets:

make fmt     # gofmt
make lint    # golangci-lint
make tidy    # go mod tidy

Part of the patent.dev open-source patent data ecosystem:

  • epo-ops - EPO Open Patent Services client (bibliographic, full text, families, legal status, images)
  • epo-bdds - EPO Bulk Data Distribution Service client (DOCDB, INPADOC, EP full text)
  • uspto-odp - USPTO Open Data Portal client (patents, PTAB, TSDR, full text)

The bulk-file-loader uses these libraries for automated patent data downloads.

License

MIT - Funktionslust GmbH / patent.dev.

Documentation

Overview

Package dpmaconnect provides a Go client for the DPMA Connect Plus API (DPMAregister web services) for accessing German patent, design, and trademark data from the German Patent and Trade Mark Office (DPMA).

Usage:

config := dpmaconnect.DefaultConfig()
config.Username = "your-username"
config.Password = "your-password"
client, err := dpmaconnect.NewClient(config)

The client is safe for concurrent use by multiple goroutines.

Index

Examples

Constants

View Source
const (
	PeriodDaily   = "daily"
	PeriodWeekly  = "weekly"
	PeriodMonthly = "monthly"
	PeriodYearly  = "yearly"
)

Period constants for register extract queries

View Source
const (
	ServicePatent    = "DPMAregisterPatService"
	ServiceDesign    = "DPMAregisterGsmService"
	ServiceTrademark = "DPMAregisterMarkeService"
)

Service name constants for GetVersion

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(date time.Time) string

FormatDate formats a time.Time into YYYY-MM-DD format for register extract queries. The date is formatted in the input's location (no timezone conversion). Example: FormatDate(time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)) returns "2024-10-23"

Example
package main

import (
	"fmt"
	"time"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	date := time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)
	fmt.Println(dpma.FormatDate(date))
}
Output:
2024-10-23

func FormatPublicationWeek

func FormatPublicationWeek(year, week int) (string, error)

FormatPublicationWeek formats year and week into YYYYWW format. Returns an error if year < 1 or week is outside [1, 53]. Example: FormatPublicationWeek(2024, 45) returns "202445"

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	pubWeek, err := dpma.FormatPublicationWeek(2024, 45)
	if err != nil {
		panic(err)
	}
	fmt.Println(pubWeek)
}
Output:
202445

func ParsePublicationWeek

func ParsePublicationWeek(pubWeek string) (year, week int, err error)

ParsePublicationWeek parses a publication week string (YYYYWW) into year and week integers Returns an error if the format is invalid

func ValidateDesignQuery

func ValidateDesignQuery(q string) error

ValidateDesignQuery parses and validates a query against design field codes. Returns nil if valid, or an error describing the validation failure.

func ValidatePatentQuery

func ValidatePatentQuery(q string) error

ValidatePatentQuery parses and validates a query against patent field codes. Returns nil if valid, or an error describing the validation failure.

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	// A valid query against the patent field codes returns nil.
	fmt.Println(dpma.ValidatePatentQuery("TI=Elektrofahrzeug AND INH=Siemens"))
	// An unknown field code is rejected.
	fmt.Println(dpma.ValidatePatentQuery("MARKE=test") != nil)
}
Output:
<nil>
true

func ValidatePeriod

func ValidatePeriod(period string) error

ValidatePeriod checks that a period string is one of the valid values.

func ValidateTrademarkQuery

func ValidateTrademarkQuery(q string) error

ValidateTrademarkQuery parses and validates a query against trademark field codes. Returns nil if valid, or an error describing the validation failure.

Types

type APIError

type APIError struct {
	Code       string
	Message    string
	StatusCode int
}

APIError represents a generic API error from DPMA

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the main DPMA Connect Plus API client. It is safe for concurrent use by multiple goroutines.

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient creates a new DPMA Connect Plus API client

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	config := dpma.DefaultConfig()
	config.Username = "your-username"
	config.Password = "your-password"

	client, err := dpma.NewClient(config)
	if err != nil {
		panic(err)
	}
	fmt.Println(client != nil)
}
Output:
true

func (*Client) GetApplicantCitationsXML

func (c *Client) GetApplicantCitationsXML(ctx context.Context, year, week int) ([]byte, error)

GetApplicantCitationsXML downloads applicant citations as XML for a publication week

func (*Client) GetApplicantCitationsXMLStream

func (c *Client) GetApplicantCitationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetApplicantCitationsXMLStream downloads applicant citations as XML and writes to dst

func (*Client) GetDesignBibliographicDataXML

func (c *Client) GetDesignBibliographicDataXML(ctx context.Context, year, week int) ([]byte, error)

GetDesignBibliographicDataXML downloads design bibliographic data as XML for a publication week

func (*Client) GetDesignBibliographicDataXMLStream

func (c *Client) GetDesignBibliographicDataXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetDesignBibliographicDataXMLStream downloads design bibliographic data as XML and writes to dst

func (*Client) GetDesignImage

func (c *Client) GetDesignImage(ctx context.Context, designNumber, imageNumber string) ([]byte, error)

GetDesignImage downloads a design image by design number and image number

func (*Client) GetDesignImages

func (c *Client) GetDesignImages(ctx context.Context, year, week int) ([]byte, error)

GetDesignImages downloads design images for a publication week

func (*Client) GetDesignImagesStream

func (c *Client) GetDesignImagesStream(ctx context.Context, year, week int, dst io.Writer) error

GetDesignImagesStream downloads design images and writes to dst

func (*Client) GetDesignInfo

func (c *Client) GetDesignInfo(ctx context.Context, designNumber string) ([]byte, error)

GetDesignInfo retrieves design information by design number

func (*Client) GetDesignInfoParsed

func (c *Client) GetDesignInfoParsed(ctx context.Context, designNumber string) (*DesignInfo, error)

GetDesignInfoParsed retrieves design info and returns parsed data.

func (*Client) GetDesignRegisterExtract

func (c *Client) GetDesignRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetDesignRegisterExtract downloads design register extract data for a date and period

func (*Client) GetDesignRegisterExtractStream

func (c *Client) GetDesignRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetDesignRegisterExtractStream downloads design register extract data and writes to dst

func (*Client) GetDesignThumbnail

func (c *Client) GetDesignThumbnail(ctx context.Context, designNumber, thumbnailNumber string) ([]byte, error)

GetDesignThumbnail downloads a design thumbnail by design number and thumbnail number

func (*Client) GetDisclosureDocumentsPDF

func (c *Client) GetDisclosureDocumentsPDF(ctx context.Context, year, week int) ([]byte, error)

GetDisclosureDocumentsPDF downloads disclosure documents as PDF for a publication week

func (*Client) GetDisclosureDocumentsPDFStream

func (c *Client) GetDisclosureDocumentsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetDisclosureDocumentsPDFStream downloads disclosure documents as PDF and writes to dst

func (*Client) GetDisclosureDocumentsXML

func (c *Client) GetDisclosureDocumentsXML(ctx context.Context, year, week int) ([]byte, error)

GetDisclosureDocumentsXML downloads disclosure documents (A) as XML for a publication week

func (*Client) GetDisclosureDocumentsXMLStream

func (c *Client) GetDisclosureDocumentsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetDisclosureDocumentsXMLStream downloads disclosure documents as XML and writes to dst

func (*Client) GetEuropeanPatentSpecificationsPDF

func (c *Client) GetEuropeanPatentSpecificationsPDF(ctx context.Context, year, week int) ([]byte, error)

GetEuropeanPatentSpecificationsPDF downloads European patent specifications as PDF for a publication week

func (*Client) GetEuropeanPatentSpecificationsPDFStream

func (c *Client) GetEuropeanPatentSpecificationsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetEuropeanPatentSpecificationsPDFStream downloads European patent specifications as PDF and writes to dst

func (*Client) GetEuropeanPatentSpecificationsXML

func (c *Client) GetEuropeanPatentSpecificationsXML(ctx context.Context, year, week int) ([]byte, error)

GetEuropeanPatentSpecificationsXML downloads European patent specifications as XML for a publication week

func (*Client) GetEuropeanPatentSpecificationsXMLStream

func (c *Client) GetEuropeanPatentSpecificationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetEuropeanPatentSpecificationsXMLStream downloads European patent specifications as XML and writes to dst

func (*Client) GetPatentInfo

func (c *Client) GetPatentInfo(ctx context.Context, registeredNumber string) ([]byte, error)

GetPatentInfo retrieves patent information by registered number (digits only, including check digit).

func (*Client) GetPatentInfoByPublicationNumber

func (c *Client) GetPatentInfoByPublicationNumber(ctx context.Context, publicationNumber string) (*PatentInfo, error)

GetPatentInfoByPublicationNumber resolves a DE publication number (e.g. "DE102019200907A1") to a registered number via search and returns the parsed patent info.

func (*Client) GetPatentInfoParsed

func (c *Client) GetPatentInfoParsed(ctx context.Context, patentNumber string) (*PatentInfo, error)

GetPatentInfoParsed retrieves patent info and returns parsed bibliographic data. Accepts either a bare registered number (e.g., "100273629") or a DE patent number with country prefix and/or kind code (e.g., "DE10027362C2", "DE102019200907A1"). For non-registered numbers, it resolves via publication number search automatically.

func (*Client) GetPatentPublicationPDF

func (c *Client) GetPatentPublicationPDF(ctx context.Context, documentID string) ([]byte, error)

GetPatentPublicationPDF downloads a single patent publication in PDF format

func (*Client) GetPatentRegisterExtract

func (c *Client) GetPatentRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetPatentRegisterExtract downloads patent register extract data for a date and period

func (*Client) GetPatentRegisterExtractStream

func (c *Client) GetPatentRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetPatentRegisterExtractStream downloads patent register extract data and writes to dst

func (*Client) GetPatentSpecificationsPDF

func (c *Client) GetPatentSpecificationsPDF(ctx context.Context, year, week int) ([]byte, error)

GetPatentSpecificationsPDF downloads patent specifications as PDF for a publication week

func (*Client) GetPatentSpecificationsPDFStream

func (c *Client) GetPatentSpecificationsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetPatentSpecificationsPDFStream downloads patent specifications as PDF and writes to dst

func (*Client) GetPatentSpecificationsXML

func (c *Client) GetPatentSpecificationsXML(ctx context.Context, year, week int) ([]byte, error)

GetPatentSpecificationsXML downloads patent specifications (B, C) as XML for a publication week

func (*Client) GetPatentSpecificationsXMLStream

func (c *Client) GetPatentSpecificationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetPatentSpecificationsXMLStream downloads patent specifications as XML and writes to dst

func (*Client) GetPublicationDataXML

func (c *Client) GetPublicationDataXML(ctx context.Context, year, week int) ([]byte, error)

GetPublicationDataXML downloads publication data as XML for a publication week

func (*Client) GetPublicationDataXMLStream

func (c *Client) GetPublicationDataXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetPublicationDataXMLStream downloads publication data as XML and writes to dst

func (*Client) GetSearchableFullText

func (c *Client) GetSearchableFullText(ctx context.Context, documentID string) ([]byte, error)

GetSearchableFullText retrieves the searchable full text for a document

func (*Client) GetTrademarkBibDataApplied

func (c *Client) GetTrademarkBibDataApplied(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataApplied downloads trademark bibliographic data (applied) for a publication week

func (*Client) GetTrademarkBibDataAppliedStream

func (c *Client) GetTrademarkBibDataAppliedStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataAppliedStream downloads trademark bib data (applied) and writes to dst

func (*Client) GetTrademarkBibDataRegistered

func (c *Client) GetTrademarkBibDataRegistered(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataRegistered downloads trademark bibliographic data (registered) for a publication week

func (*Client) GetTrademarkBibDataRegisteredStream

func (c *Client) GetTrademarkBibDataRegisteredStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataRegisteredStream downloads trademark bib data (registered) and writes to dst

func (*Client) GetTrademarkBibDataRejected

func (c *Client) GetTrademarkBibDataRejected(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataRejected downloads trademark bibliographic data (rejected) for a publication week

func (*Client) GetTrademarkBibDataRejectedStream

func (c *Client) GetTrademarkBibDataRejectedStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataRejectedStream downloads trademark bib data (rejected) and writes to dst

func (*Client) GetTrademarkImage

func (c *Client) GetTrademarkImage(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkImage downloads a trademark image by application number

func (*Client) GetTrademarkInfo

func (c *Client) GetTrademarkInfo(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkInfo retrieves trademark information by application number

func (*Client) GetTrademarkInfoParsed

func (c *Client) GetTrademarkInfoParsed(ctx context.Context, applicationNumber string) (*TrademarkInfo, error)

GetTrademarkInfoParsed retrieves trademark info and returns parsed data.

func (*Client) GetTrademarkRegisterExtract

func (c *Client) GetTrademarkRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetTrademarkRegisterExtract downloads trademark register extract data for a date and period

func (*Client) GetTrademarkRegisterExtractStream

func (c *Client) GetTrademarkRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetTrademarkRegisterExtractStream downloads trademark register extract data and writes to dst

func (*Client) GetTrademarkThumbnail

func (c *Client) GetTrademarkThumbnail(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkThumbnail downloads a trademark thumbnail by application number

func (*Client) GetUtilityModelsPDF

func (c *Client) GetUtilityModelsPDF(ctx context.Context, year, week int) ([]byte, error)

GetUtilityModelsPDF downloads utility models as PDF for a publication week

func (*Client) GetUtilityModelsPDFStream

func (c *Client) GetUtilityModelsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetUtilityModelsPDFStream downloads utility models as PDF and writes to dst

func (*Client) GetUtilityModelsXML

func (c *Client) GetUtilityModelsXML(ctx context.Context, year, week int) ([]byte, error)

GetUtilityModelsXML downloads utility models (U) as XML for a publication week

func (*Client) GetUtilityModelsXMLStream

func (c *Client) GetUtilityModelsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetUtilityModelsXMLStream downloads utility models as XML and writes to dst

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context, service string) (string, error)

GetVersion retrieves version information for a service

func (*Client) SearchDesigns

func (c *Client) SearchDesigns(ctx context.Context, query string) ([]byte, error)

SearchDesigns executes a design expert search query

func (*Client) SearchDesignsParsed

func (c *Client) SearchDesignsParsed(ctx context.Context, query string) (*DesignSearchResult, error)

SearchDesignsParsed executes a design search and returns parsed results.

func (*Client) SearchPatents

func (c *Client) SearchPatents(ctx context.Context, query string) ([]byte, error)

SearchPatents executes a patent/utility model expert search query

func (*Client) SearchPatentsParsed

func (c *Client) SearchPatentsParsed(ctx context.Context, query string) (*PatentSearchResult, error)

SearchPatentsParsed executes a patent search and returns parsed results.

func (*Client) SearchTrademarks

func (c *Client) SearchTrademarks(ctx context.Context, query string) ([]byte, error)

SearchTrademarks executes a trademark expert search query

func (*Client) SearchTrademarksParsed

func (c *Client) SearchTrademarksParsed(ctx context.Context, query string) (*TrademarkSearchResult, error)

SearchTrademarksParsed executes a trademark search and returns parsed results.

type Config

type Config struct {
	BaseURL    string
	Username   string
	Password   string
	Timeout    time.Duration // HTTP client timeout (default: 20 minutes for bulk downloads)
	HTTPClient *http.Client  // Optional custom HTTP client; if set, Timeout is ignored
}

Config holds client configuration.

If HTTPClient is set, Timeout is ignored and the custom client's timeout applies instead. Callers should configure timeouts on the custom client directly.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

type DataNotAvailableError

type DataNotAvailableError struct{}

DataNotAvailableError represents data unavailable for requested period

func (*DataNotAvailableError) Error

func (e *DataNotAvailableError) Error() string

type DesignClass added in v0.3.1

type DesignClass struct {
	ClassificationKindCode string
	ClassificationVersion  string
	Comment                string
	ClassNumber            string
	Description            string
}

DesignClass represents an indication-product classification entry.

type DesignEntry added in v0.3.1

type DesignEntry struct {
	DesignIdentifier   string
	RegistrationNumber string
	RegistrationDate   string
	Title              string
	TotalSpecimen      string
	Status             string
	Classes            []DesignClass
	Priorities         []DesignPriority
	Representations    []DesignView // representation sheet views
	PreferedView       *DesignView
	Records            []DesignRecord // register-event history
	Applicants         []Party        // design-level applicants
	Representatives    []Party
	Extension          DesignExtensionInfo
}

DesignEntry represents one design within a registration.

type DesignExtensionInfo added in v0.3.1

type DesignExtensionInfo struct {
	RegisterNumber                string
	DesignFileNumber              string
	DesignNumber                  string
	DateOfCaptureInSystem         string
	TypeOfDeposit                 string
	DefermentStatus               string
	TermProtectionObtained        string
	PaymentDeadline               string
	KindOfFee                     string
	DestructionPaperFile          string
	DesignDescriptionNotPublished string
	CancellationDate              string
}

DesignExtensionInfo holds the DE_ST86Extension scalar fields.

type DesignHit

type DesignHit struct {
	DesignIdentifier                 string
	ApplicationNumber                string
	RegistrationNumber               string
	TotalRepresentationSheet         string
	FirstRepresentationSheetFilename string
	Title                            string
	Applicant                        string
	Representative                   string
	StaffName                        string
	ClassNumber                      string
	Status                           string
	ApplicationDate                  string
	RegistrationDate                 string
	PublicationDate                  string
}

DesignHit represents a single design search result entry.

type DesignInfo

type DesignInfo struct {
	RegistrationOfficeCode string
	ApplicationNumber      string
	ApplicationReference   string
	ApplicationDate        string
	TotalDesign            string
	Designs                []DesignEntry // all designs in a multi-design registration
	Applicants             []Party       // application-level applicants
	CorrespondenceParty    Party
	RawXML                 []byte // original XML response bytes

	// Convenience fields mirroring the first design (back-compat).
	DesignIdentifier   string
	RegistrationNumber string
	RegistrationDate   string
	Title              string
	Status             string
	ClassNumber        string
	ClassDescription   string
}

DesignInfo holds parsed design register info (ST86).

func ParseDesignInfo

func ParseDesignInfo(data []byte) (*DesignInfo, error)

ParseDesignInfo parses a design info XML response (ST86 format).

type DesignPriority added in v0.3.1

type DesignPriority struct {
	CountryCode string
	Number      string
	Date        string
}

DesignPriority represents a priority claim of a design.

type DesignRecord added in v0.3.1

type DesignRecord struct {
	FilingDate            string
	LanguageCode          string
	PublicationIdentifier string
	PublicationSubsection string
	PublicationDate       string
	LegalStatus           string
}

DesignRecord represents one design register-event (DesignRecord) entry.

type DesignSearchResult

type DesignSearchResult struct {
	TotalHits    int
	DocumentHits int
	DatabaseHits int
	Hits         []DesignHit
	RawXML       []byte // original XML response bytes
}

DesignSearchResult holds parsed design search results.

func ParseDesignSearch

func ParseDesignSearch(data []byte) (*DesignSearchResult, error)

ParseDesignSearch parses a design search XML response.

type DesignView added in v0.3.1

type DesignView struct {
	Filename string
	Format   string
	Number   string
	Height   string
	Width    string
	Unit     string
}

DesignView represents an image/representation view.

type ErrorResponse

type ErrorResponse struct {
	XMLName       xml.Name        `xml:"Transaction"`
	TradeMarkBody transactionBody `xml:"TradeMarkTransactionBody"`
	DesignBody    transactionBody `xml:"DesignTransactionBody"`
	PatentBody    transactionBody `xml:"PatentTransactionBody"`
}

ErrorResponse represents the XML error response structure from DPMA API. The DPMA API uses different body element names depending on the service:

  • TradeMarkTransactionBody (trademark service)
  • DesignTransactionBody (design service)
  • PatentTransactionBody (patent service)

All share the same nested TransactionErrorDetails structure. We parse all three variants and use whichever has error content.

type NotFoundError

type NotFoundError struct {
	Resource string
	ID       string
}

NotFoundError represents resource not found errors

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Party

type Party struct {
	Text     string // full free-format line as returned by the office, if present
	Name     string
	Address  string
	Street   string
	Postcode string
	Country  string
	Sequence string // @sequence attribute, when present
	AppType  string // applicant @app-type attribute, when present
}

Party represents a person or organization (applicant, inventor, agent, etc.)

type PatentClassification added in v0.3.1

type PatentClassification struct {
	Sequence         string
	Symbol           string // <text>
	VersionIndicator string // <ipc-version-indicator>
}

PatentClassification represents a classification-ipcr entry with version.

type PatentDocumentRef

type PatentDocumentRef struct {
	Country string
	Number  string
	Date    string
}

PatentDocumentRef represents an application or document reference.

type PatentEvent added in v0.3.1

type PatentEvent struct {
	TypeOfProcedure        string
	ProceduralStatus       string
	DateOfProceduralStatus string
	PublicationInfo        *PatentEventPublication
	IPCMainClass           *PatentIPCClass
	PreviousIPCMainClass   *PatentIPCClass
	PublishedDocuments     []string
}

PatentEvent represents one legal-event / prosecution-history entry.

type PatentEventPublication added in v0.3.1

type PatentEventPublication struct {
	IssueNumber     string
	Year            string
	PublicationDate string
	PublicationType string
	Part            string
}

PatentEventPublication represents the publication-info of an event.

type PatentHit

type PatentHit struct {
	LeadingRegisteredNumber string
	RegisteredNumber        string
	Type                    string // "Patent", "Utility model"
	LegalStatus             string
	Title                   string
	Applicants              []string
	Inventors               []string
	Agent                   string
	IPCClasses              []string          // main + further classification symbols
	Classifications         []PatentSearchIPC // main + further with edition
	MainClassification      PatentSearchIPC   // main classification with edition
	FurtherClassifications  []PatentSearchIPC // further classifications with edition
	ApplicationDate         string
	PublicationDate         string
	RegistrationDate        string
}

PatentHit represents a single patent search result entry.

type PatentIPCClass added in v0.3.1

type PatentIPCClass struct {
	Symbol  string
	Version string
}

PatentIPCClass represents an ipc-main-class / previous-ipc-main-class.

type PatentInfo

type PatentInfo struct {
	SchemaVersion          string // @schema-version
	Publications           []PatentPublication
	ApplicationRef         PatentDocumentRef
	Title                  string
	TitleLang              string
	IPCClasses             []string // classification symbols (back-compat convenience)
	Classifications        []PatentClassification
	Applicants             []Party
	Inventors              []Party
	Agents                 []Party // representatives
	CorrespondenceParty    Party   // parties/correspondence-address
	PriorityClaims         []PatentPriorityClaim
	IPRightType            string // patent, gebrauchsmuster, schutzzertifikat, etc.
	Status                 string // anhaengig-in-kraft, nicht-anhaengig-erloschen
	AgentType              string // office-specific agent-type
	Abstract               string
	FilingDate             string
	FirstPubDate           string
	DateLastRegisterUpdate string
	Events                 []PatentEvent // legal-event / prosecution history
	RawXML                 []byte        // original XML response bytes
}

PatentInfo holds parsed patent register info (ST36 bibliographic data).

func ParsePatentInfo

func ParsePatentInfo(data []byte) (*PatentInfo, error)

ParsePatentInfo parses a patent info XML response (ST36 format).

type PatentPriorityClaim added in v0.3.1

type PatentPriorityClaim struct {
	Sequence  string
	Country   string
	Date      string
	DocNumber string
}

PatentPriorityClaim represents a priority-claim entry.

type PatentPublication

type PatentPublication struct {
	Sequence string
	Country  string
	Number   string
	Kind     string
	Date     string
}

PatentPublication represents a publication reference within patent info.

type PatentSearchIPC added in v0.3.1

type PatentSearchIPC struct {
	Classification string
	Edition        string
}

PatentSearchIPC is a classification symbol with its edition (patent search).

type PatentSearchResult

type PatentSearchResult struct {
	TotalHits    int
	DocumentHits int // <Counter><DocumentHits>
	DatabaseHits int // <Counter><DatabaseHits>
	Hits         []PatentHit
	RawXML       []byte // original XML response bytes
}

PatentSearchResult holds parsed patent search results.

func ParsePatentSearch

func ParsePatentSearch(data []byte) (*PatentSearchResult, error)

ParsePatentSearch parses a patent search XML response.

type TrademarkClass

type TrademarkClass struct {
	Number          string
	Description     string
	DescriptionLang string // GoodsServicesDescription @languageCode
}

TrademarkClass represents a Nice classification entry.

type TrademarkHit

type TrademarkHit struct {
	Number                 string
	RegistrationOfficeCode string
	ApplicationNumber      string
	MarkText               string
	MarkDescriptionText    string // MarkDescriptionDetails/DescriptionText
	MarkFeature            string // wortmarke, wort-bildmarke, etc.
	Classification         string
	Status                 string
	ApplicationDate        string
	RegistrationDate       string
	Applicant              string
	Representative         string
}

TrademarkHit represents a single trademark search result entry.

type TrademarkInfo

type TrademarkInfo struct {
	RegistrationOfficeCode     string
	ApplicationNumber          string
	RegistrationNumber         string
	ApplicationDate            string
	RegistrationDate           string
	ExpiryDate                 string
	TerminationDate            string
	Status                     string
	KindMark                   string
	MarkFeature                string
	OppositionPeriodStartDate  string
	OppositionPeriodEndDate    string
	MarkText                   string
	MarkTextLang               string // MarkVerbalElementText @languageCode
	StandardCharacterIndicator string // MarkStandardCharacterIndicator
	ProposedLeadingClassNumber string
	Applicants                 []Party
	Representatives            []Party
	CorrespondenceParty        Party
	Classifications            []TrademarkClass
	Records                    []TrademarkRecord // register-event history
	FileNumber                 string            // de:FileNumber
	MarkFeatureDPMA            string            // de:MarkFeatureDPMA
	RawXML                     []byte            // original XML response bytes
}

TrademarkInfo holds parsed trademark register info (ST66).

func ParseTrademarkInfo

func ParseTrademarkInfo(data []byte) (*TrademarkInfo, error)

ParseTrademarkInfo parses a trademark info XML response (ST66 format).

type TrademarkRecord added in v0.3.1

type TrademarkRecord struct {
	RecordIdentifier       string
	BasicRecordKind        string
	PublicationIdentifier  string
	PublicationSection     string
	PublicationDate        string
	CurrentStatusCode      string
	CurrentStatusDate      string
	LegalGround            string // de:Record5f/de:LegalGround
	CancellationDate       string // de:Record5f/de:CancellationDate
	CorrectionText         string // de:CorrectionIncomplete/de:CorrectionText
	ImageCorrected         string // de:CorrectionIncomplete/de:ImageCorrected
	ReceiptDeclarationDate string // de:TransferIncomplete/de:ReceiptDeclarationDate
	PreviousHolder         *Party
	NewHolder              *Party
}

TrademarkRecord represents one register-event (MarkRecord) entry, including the de:-namespaced extension details (ownership transfer, cancellation, correction history).

type TrademarkSearchResult

type TrademarkSearchResult struct {
	TotalHits    int
	DocumentHits int
	DatabaseHits int
	Hits         []TrademarkHit
	RawXML       []byte // original XML response bytes
}

TrademarkSearchResult holds parsed trademark search results.

func ParseTrademarkSearch

func ParseTrademarkSearch(data []byte) (*TrademarkSearchResult, error)

ParseTrademarkSearch parses a trademark search XML response.

type XMLParseError

type XMLParseError struct {
	Operation string // e.g. "ParsePatentSearch"
	Err       error  // underlying xml.Unmarshal error
}

XMLParseError indicates a failure to parse XML response data.

func (*XMLParseError) Error

func (e *XMLParseError) Error() string

func (*XMLParseError) Unwrap

func (e *XMLParseError) Unwrap() error

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.
Package query provides a query parser and validator for DPMAregister expert search syntax.
Package query provides a query parser and validator for DPMAregister expert search syntax.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL