An open API service indexing awesome lists of open source software.

https://github.com/diging/crossref-connect

Connector to Crossref API
https://github.com/diging/crossref-connect

Last synced: 13 days ago
JSON representation

Connector to Crossref API

Awesome Lists containing this project

README

          

# Java Crossref Connector

This project provides a simple interface to query [Crossref's public API](https://api.crossref.org/swagger-ui/index.html).

## Installation

Using Maven, include the following plugin:
```xml

edu.asu.diging
crossref-connect
0.1

```

## Usage

Use the plugin as follows:

```java
CrossrefWorksService service = new CrossrefWorksServiceImpl(CrossrefConfiguration.getDefaultConfig());
try {
// search takes: query string, page size, and offset
List results = service.search("einstein", 5, 0);
// do something with the results
results.forEach(r -> System.out.println(r.getTitle()));
} catch (IOException e) {
// handle exception
e.printStackTrace();
} catch (RequestFailedException e) {
// handle exception
e.printStackTrace();
}
```

If for some reason, the default parameter to connect to Crossref need to be changed, customized `CrossrefConfiguration` can be used by either implementing a new `CrossrefConfiguration` class or adjusting the values in the `DefaultCrossrefConfiguration`.