View Source Uspto (openapi_compiler v1.0.0-beta.18)

USPTO Data Set API - 1.0.0

The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.

Open Data Portal - developer@uspto.gov - https://developer.uspto.gov

Link to this section Summary

Link to this section Types

Link to this type

get_dataset_version_fields_config()

View Source
@type get_dataset_version_fields_config() :: %{
  optional(:server) => server_parameters(),
  optional(:body) => any(),
  :path => get_dataset_version_fields_config_path(),
  optional(:query) => get_dataset_version_fields_config_query(),
  optional(:headers) => get_dataset_version_fields_config_header(),
  optional(:opts) => Tesla.Env.opts()
}
Link to this type

get_dataset_version_fields_config_header()

View Source
@type get_dataset_version_fields_config_header() :: %{optional(String.t()) => any()}
Link to this type

get_dataset_version_fields_config_path()

View Source
@type get_dataset_version_fields_config_path() :: %{
  :dataset => String.t(),
  :version => String.t(),
  optional(String.t()) => any()
}
Link to this type

get_dataset_version_fields_config_query()

View Source
@type get_dataset_version_fields_config_query() :: %{optional(String.t()) => any()}
Link to this type

get_dataset_version_fields_response()

View Source
@type get_dataset_version_fields_response() ::
  response(get_dataset_version_fields_response_options())
Link to this type

get_dataset_version_fields_response_options()

View Source
@type get_dataset_version_fields_response_options() ::
  {404, String.t(), Tesla.Env.t()} | {200, String.t(), Tesla.Env.t()}
@type get_root_config() :: %{
  optional(:server) => server_parameters(),
  optional(:body) => any(),
  optional(:query) => get_root_config_query(),
  optional(:headers) => get_root_config_header(),
  optional(:opts) => Tesla.Env.opts()
}
Link to this type

get_root_config_header()

View Source
@type get_root_config_header() :: %{optional(String.t()) => any()}
Link to this type

get_root_config_query()

View Source
@type get_root_config_query() :: %{optional(String.t()) => any()}
@type get_root_response() :: response(get_root_response_options())
Link to this type

get_root_response_options()

View Source
@type get_root_response_options() ::
  {200, Uspto.Schema.Read.data_set_list(), Tesla.Env.t()}
@type option() ::
  {:method, Tesla.Env.method()}
  | {:url, Tesla.Env.url()}
  | {:query, Tesla.Env.query()}
  | {:headers, Tesla.Env.headers()}
  | {:body, Tesla.Env.body()}
  | {:opts, Tesla.Env.opts()}

Options that may be passed to a request function. See request/2 for detailed descriptions.

Link to this type

post_dataset_version_records_config()

View Source
@type post_dataset_version_records_config() :: %{
  optional(:server) => server_parameters(),
  optional(:body) => post_dataset_version_records_config_request_body(),
  :path => post_dataset_version_records_config_path(),
  optional(:query) => post_dataset_version_records_config_query(),
  optional(:headers) => post_dataset_version_records_config_header(),
  optional(:opts) => Tesla.Env.opts()
}
Link to this type

post_dataset_version_records_config_header()

View Source
@type post_dataset_version_records_config_header() :: %{optional(String.t()) => any()}
Link to this type

post_dataset_version_records_config_path()

View Source
@type post_dataset_version_records_config_path() :: %{
  :version => String.t(),
  :dataset => String.t(),
  optional(String.t()) => any()
}
Link to this type

post_dataset_version_records_config_query()

View Source
@type post_dataset_version_records_config_query() :: %{optional(String.t()) => any()}
Link to this type

post_dataset_version_records_config_request_body()

View Source
@type post_dataset_version_records_config_request_body() :: %{
  :criteria => String.t(),
  optional(:rows) => integer(),
  optional(:start) => integer()
}
Link to this type

post_dataset_version_records_response()

View Source
@type post_dataset_version_records_response() ::
  response(post_dataset_version_records_response_options())
Link to this type

post_dataset_version_records_response_options()

View Source
@type post_dataset_version_records_response_options() ::
  {404, any(), Tesla.Env.t()} | {200, [map()], Tesla.Env.t()}
Link to this type

response(possible_responses)

View Source
@type response(possible_responses) ::
  {:ok, possible_responses}
  | {:error, {:unexpected_response, Tesla.Env.t()} | any()}
@type server_parameters() :: %{optional(:scheme) => :http | :https}

Link to this section Functions

Link to this function

delete!(client, url, opts)

View Source
@spec delete!(Tesla.Env.client(), Tesla.Env.url(), [option()]) ::
  Tesla.Env.t() | no_return()

Perform a DELETE request.

See request!/1 or request!/2 for options definition.

delete!("/users")
delete!("/users", query: [scope: "admin"])
delete!(client, "/users")
delete!(client, "/users", query: [scope: "admin"])
delete!(client, "/users", body: %{name: "Jon"})
Link to this function

delete(client, url, opts)

View Source
@spec delete(Tesla.Env.client(), Tesla.Env.url(), [option()]) :: Tesla.Env.result()

Perform a DELETE request.

See request/1 or request/2 for options definition.

delete("/users")
delete("/users", query: [scope: "admin"])
delete(client, "/users")
delete(client, "/users", query: [scope: "admin"])
delete(client, "/users", body: %{name: "Jon"})
@spec get!(Tesla.Env.client(), Tesla.Env.url(), [option()]) ::
  Tesla.Env.t() | no_return()

Perform a GET request.

See request!/1 or request!/2 for options definition.

get!("/users")
get!("/users", query: [scope: "admin"])
get!(client, "/users")
get!(client, "/users", query: [scope: "admin"])
get!(client, "/users", body: %{name: "Jon"})

Perform a GET request.

See request/1 or request/2 for options definition.

get("/users")
get("/users", query: [scope: "admin"])
get(client, "/users")
get(client, "/users", query: [scope: "admin"])
get(client, "/users", body: %{name: "Jon"})
Link to this function

get_dataset_version_fields(client \\ %Tesla.Client{}, config)

View Source
@spec get_dataset_version_fields(
  client :: Tesla.Client.t(),
  config :: get_dataset_version_fields_config()
) :: get_dataset_version_fields_response()

GET /{dataset}/{version}/fields

This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.

Link to this function

get_root(client \\ %Tesla.Client{}, config)

View Source
@spec get_root(client :: Tesla.Client.t(), config :: get_root_config()) ::
  get_root_response()

GET /

Link to this function

head!(client, url, opts)

View Source
@spec head!(Tesla.Env.client(), Tesla.Env.url(), [option()]) ::
  Tesla.Env.t() | no_return()

Perform a HEAD request.

See request!/1 or request!/2 for options definition.

head!("/users")
head!("/users", query: [scope: "admin"])
head!(client, "/users")
head!(client, "/users", query: [scope: "admin"])
head!(client, "/users", body: %{name: "Jon"})

Perform a HEAD request.

See request/1 or request/2 for options definition.

head("/users")
head("/users", query: [scope: "admin"])
head(client, "/users")
head(client, "/users", query: [scope: "admin"])
head(client, "/users", body: %{name: "Jon"})
Link to this function

list_data_sets(client \\ %Tesla.Client{}, config)

View Source

See Uspto.get_root/2.

Link to this function

list_searchable_fields(client \\ %Tesla.Client{}, config)

View Source

See Uspto.get_dataset_version_fields/2.

Link to this function

options!(client, url, opts)

View Source
@spec options!(Tesla.Env.client(), Tesla.Env.url(), [option()]) ::
  Tesla.Env.t() | no_return()

Perform a OPTIONS request.

See request!/1 or request!/2 for options definition.

options!("/users")
options!("/users", query: [scope: "admin"])
options!(client, "/users")
options!(client, "/users", query: [scope: "admin"])
options!(client, "/users", body: %{name: "Jon"})
Link to this function

options(client, url, opts)

View Source
@spec options(Tesla.Env.client(), Tesla.Env.url(), [option()]) :: Tesla.Env.result()

Perform a OPTIONS request.

See request/1 or request/2 for options definition.

options("/users")
options("/users", query: [scope: "admin"])
options(client, "/users")
options(client, "/users", query: [scope: "admin"])
options(client, "/users", body: %{name: "Jon"})
Link to this function

patch!(client, url, body, opts)

View Source

Perform a PATCH request.

See request!/1 or request!/2 for options definition.

patch!("/users", %{name: "Jon"})
patch!("/users", %{name: "Jon"}, query: [scope: "admin"])
patch!(client, "/users", %{name: "Jon"})
patch!(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

patch(client, url, body, opts)

View Source

Perform a PATCH request.

See request/1 or request/2 for options definition.

patch("/users", %{name: "Jon"})
patch("/users", %{name: "Jon"}, query: [scope: "admin"])
patch(client, "/users", %{name: "Jon"})
patch(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

perform_search(client \\ %Tesla.Client{}, config)

View Source

See Uspto.post_dataset_version_records/2.

Link to this function

post!(client, url, body, opts)

View Source

Perform a POST request.

See request!/1 or request!/2 for options definition.

post!("/users", %{name: "Jon"})
post!("/users", %{name: "Jon"}, query: [scope: "admin"])
post!(client, "/users", %{name: "Jon"})
post!(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

post(client, url, body, opts)

View Source

Perform a POST request.

See request/1 or request/2 for options definition.

post("/users", %{name: "Jon"})
post("/users", %{name: "Jon"}, query: [scope: "admin"])
post(client, "/users", %{name: "Jon"})
post(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

post_dataset_version_records(client \\ %Tesla.Client{}, config)

View Source
@spec post_dataset_version_records(
  client :: Tesla.Client.t(),
  config :: post_dataset_version_records_config()
) :: post_dataset_version_records_response()

POST /{dataset}/{version}/records

This API is based on Solr/Lucense Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.

Link to this function

put!(client, url, body, opts)

View Source

Perform a PUT request.

See request!/1 or request!/2 for options definition.

put!("/users", %{name: "Jon"})
put!("/users", %{name: "Jon"}, query: [scope: "admin"])
put!(client, "/users", %{name: "Jon"})
put!(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

put(client, url, body, opts)

View Source

Perform a PUT request.

See request/1 or request/2 for options definition.

put("/users", %{name: "Jon"})
put("/users", %{name: "Jon"}, query: [scope: "admin"])
put(client, "/users", %{name: "Jon"})
put(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

request!(client \\ %Tesla.Client{}, options)

View Source
@spec request!(Tesla.Env.client(), [option()]) :: Tesla.Env.t() | no_return()

Perform request and raise in case of error.

This is similar to request/2 behaviour from Tesla 0.x

See request/2 for list of available options.

Link to this function

request(client \\ %Tesla.Client{}, options)

View Source
@spec request(Tesla.Env.client(), [option()]) :: Tesla.Env.result()

Perform a request.

options

Options

  • :method - the request method, one of [:head, :get, :delete, :trace, :options, :post, :put, :patch]
  • :url - either full url e.g. "http://example.com/some/path" or just "/some/path" if using Tesla.Middleware.BaseUrl
  • :query - a keyword list of query params, e.g. [page: 1, per_page: 100]
  • :headers - a keyworld list of headers, e.g. [{"content-type", "text/plain"}]
  • :body - depends on used middleware:
    • by default it can be a binary
    • if using e.g. JSON encoding middleware it can be a nested map
    • if adapter supports it it can be a Stream with any of the above
  • :opts - custom, per-request middleware or adapter options

examples

Examples

ExampleApi.request(method: :get, url: "/users/path")

# use shortcut methods
ExampleApi.get("/users/1")
ExampleApi.post(client, "/users", %{name: "Jon"})
Link to this function

trace!(client, url, opts)

View Source
@spec trace!(Tesla.Env.client(), Tesla.Env.url(), [option()]) ::
  Tesla.Env.t() | no_return()

Perform a TRACE request.

See request!/1 or request!/2 for options definition.

trace!("/users")
trace!("/users", query: [scope: "admin"])
trace!(client, "/users")
trace!(client, "/users", query: [scope: "admin"])
trace!(client, "/users", body: %{name: "Jon"})
Link to this function

trace(client, url, opts)

View Source

Perform a TRACE request.

See request/1 or request/2 for options definition.

trace("/users")
trace("/users", query: [scope: "admin"])
trace(client, "/users")
trace(client, "/users", query: [scope: "admin"])
trace(client, "/users", body: %{name: "Jon"})