https://github.com/goark/openbd-api
APIs for openBD by Golang
https://github.com/goark/openbd-api
api-rest api-wrapper go golang golang-package openbd
Last synced: 5 months ago
JSON representation
APIs for openBD by Golang
- Host: GitHub
- URL: https://github.com/goark/openbd-api
- Owner: goark
- License: apache-2.0
- Created: 2019-08-15T04:39:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-20T07:43:38.000Z (about 4 years ago)
- Last Synced: 2025-10-13T09:57:20.352Z (8 months ago)
- Topics: api-rest, api-wrapper, go, golang, golang-package, openbd
- Language: Go
- Size: 90.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [openbd-api] -- APIs for openBD by Golang
[](https://github.com/goark/openbd-api/actions)
[](https://github.com/goark/openbd-api/actions)
[](https://raw.githubusercontent.com/goark/openbd-api/master/LICENSE)
[](https://github.com/goark/openbd-api/releases/latest)
This package is required Go 1.16 or later.
**Migrated repository to [github.com/goark/openbd-api][openbd-api]**
## Usage of package
### Import Package
```
import "github.com/goark/openbd-api"
```
### Lookup openBD Book Data
```go
books, err := openbd.DefaultClient().LookupBook([]string{"9784797369915", "9784274069321"})
```
## Entities for openBD
### Book type
```go
//Book is entity class of book info.
type Book struct {
Onix Onix `json:"onix"`
Hanmoto Hanmoto `json:"hanmoto"`
Summary Summary `json:"summary"`
}
//Onix is entity class of JPRO-onix items
type Onix struct {
RecordReference string //ISBN code (key code)
NotificationType string
ProductIdentifier struct {
ProductIDType string
IDValue string //ISBN ?
}
DescriptiveDetail struct {
ProductComposition string
ProductForm string
Measure []struct {
MeasureType string
Measurement string
MeasureUnitCode string
} `json:",omitempty"`
Collection struct {
CollectionType string
CollectionSequence *struct {
CollectionSequenceType string `json:",omitempty"`
CollectionSequenceTypeName string `json:",omitempty"`
CollectionSequenceNumber string `json:",omitempty"`
} `json:",omitempty"`
TitleDetail *struct {
TitleType string `json:",omitempty"`
TitleElement []struct {
TitleElementLevel string
TitleText struct {
Content string `json:"content"`
CollationKey string `json:"collationkey,omitempty"`
}
} `json:",omitempty"`
} `json:",omitempty"`
}
TitleDetail struct {
TitleType string
TitleElement struct {
TitleElementLevel string
TitleText struct {
Content string `json:"content"`
Collationkey string `json:"collationkey,omitempty"`
}
}
}
Contributor []struct {
SequenceNumber string
ContributorRole []string `json:",omitempty"`
PersonName struct {
Content string `json:"content"`
Collationkey string `json:"collationkey,omitempty"`
}
BiographicalNote string `json:",omitempty"`
} `json:",omitempty"`
Language []struct {
LanguageRole string
LanguageCode string
CountryCode string
} `json:",omitempty"`
Extent []struct {
ExtentType string
ExtentValue string
ExtentUnit string
} `json:",omitempty"`
Subject []struct {
SubjectSchemeIdentifier string
SubjectCode string
SubjectHeadingText string `json:",omitempty"`
} `json:",omitempty"`
Audience []struct {
AudienceCodeType string
AudienceCodeValue string
} `json:",omitempty"`
}
CollateralDetail *struct {
TextContent []struct {
TextType string
ContentAudience string
Text string
} `json:",omitempty"`
SupportingResource []struct {
ResourceContentType string
ContentAudience string
ResourceMode string
ResourceVersion []struct {
ResourceForm string
ResourceVersionFeature []struct {
ResourceVersionFeatureType string
FeatureValue string
} `json:",omitempty"`
ResourceLink string
} `json:",omitempty"`
} `json:",omitempty"`
} `json:",omitempty"`
PublishingDetail struct {
Imprint struct {
ImprintIdentifier []struct {
ImprintIDType string
IDValue string
} `json:",omitempty"`
ImprintName string
}
Publisher struct {
PublisherIdentifier []struct {
PublisherIDType string
IDValue string
} `json:",omitempty"`
PublishingRole string
PublisherName string
}
PublishingDate []struct {
Date Date
PublishingDateRole string
} `json:",omitempty"`
}
ProductSupply struct {
SupplyDetail struct {
ReturnsConditions struct {
ReturnsCodeType string
ReturnsCode string
}
ProductAvailability string
Price []struct {
PriceType string
CurrencyCode string
PriceAmount string
} `json:",omitempty"`
}
}
}
//Hanmoto is entity class of Hanmoto dot com items
type Hanmoto struct {
DatePublished Date `json:"dateshuppan"`
DateModified Date `json:"datemodified"`
DateCreated Date `json:"datecreated"`
DateReleased Date `json:"datekoukai"`
IsLightNovel bool `json:"lanove,omitempty"`
HasReview bool `json:"hasshohyo,omitempty"`
Reviews []struct {
Reviewer string `json:"reviewer"`
Link string `json:"link"`
DateAppearance Date `json:"appearance"`
SourceKindID int `json:"kubun_id"`
SourceID int `json:"source_id"`
Source string `json:"source"`
PaperType string `json:"choyukan"`
PostUser string `json:"post_user"`
Han string `json:"han"`
Gou string `json:"gou"`
} `json:"reviews,omitempty"`
HasSample bool `json:"hastameshiyomi,omitempty"`
}
//Summary is entity class of summary data
type Summary struct {
ISBN string `json:"isbn"`
Title string `json:"title"`
Volume string `json:"volume"`
Series string `json:"series"`
Publisher string `json:"publisher"`
PubDate Date `json:"pubdate"`
Author string `json:"author"`
Cover string `json:"cover"`
}
```
## Command Line Interface (Sample Code)
### Download and Build
```
$ go get github.com/goark/openbd-api/cli/openbd
```
### Lookup openBD Books Data
```
$ openbd lookup 9784797369915 9784274069321
```
[openbd-api]: https://github.com/goark/openbd-api "goark/openbd-api: APIs for openBD by Golang"