elsevier

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: BSD-3-Clause Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleEntry

type ArticleEntry struct {
	Identifier      string              `json:"dc:identifier"`
	Title           string              `json:"dc:title"`
	Creator         []string            `json:"dc:creator"`
	PublicationName string              `json:"prism:publicationName"`
	CoverDate       string              `json:"prism:coverDate"`
	DOI             string              `json:"prism:doi"`
	PII             string              `json:"pii"`
	OpenAccess      bool                `json:"openaccess"`
	Link            []Link              `json:"link"`
	Authors         []map[string]string `json:"authors,omitempty"`
}

ArticleEntry represents a single article in the search results

type ArticleMetadataParams

type ArticleMetadataParams struct {
	View             string // STANDARD or COMPLETE (default: STANDARD)
	Field            string // Comma-separated list of specific fields to return
	Start            int    // Results offset (starting position)
	Count            int    // Maximum number of results to return
	SuppressNavLinks bool   // Suppress top-level navigation links
}

ArticleMetadataParams contains optional parameters for the article metadata search

type ArticleMetadataResponse

type ArticleMetadataResponse struct {
	SearchResults struct {
		TotalResults string                 `json:"opensearch:totalResults"`
		StartIndex   string                 `json:"opensearch:startIndex"`
		ItemsPerPage string                 `json:"opensearch:itemsPerPage"`
		Query        map[string]interface{} `json:"opensearch:Query"`
		Link         []Link                 `json:"link"`
		Entry        []ArticleEntry         `json:"entry"`
	} `json:"search-results"`
}

ArticleMetadataResponse represents the API response structure

type Client

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

func NewClient

func NewClient(apiKey string, options ...ClientOpt) *Client

func (*Client) ArticleMetadata

func (c *Client) ArticleMetadata(query *Query, params *ArticleMetadataParams) (*ArticleMetadataResponse, error)

ArticleMetadata searches for articles in ScienceDirect

query: https://dev.elsevier.com/sd_article_meta_tips.html

func (*Client) ArticleMetadataRaw

func (c *Client) ArticleMetadataRaw(query string, params *ArticleMetadataParams) (*ArticleMetadataResponse, error)

ArticleMetadataRaw searches performs an Article Metadata query in ScienceDirect

query: https://dev.elsevier.com/sd_article_meta_tips.html

func (*Client) Search

func (c *Client) Search(query *SearchQuery) (*SearchResponse, error)

Search searches for articles in ScienceDirect API v2

query: https://dev.elsevier.com/sd_article_meta_tips.html

type ClientOpt

type ClientOpt func(*Client)

func WithTimeout

func WithTimeout(t time.Duration) ClientOpt
type Link struct {
	Ref  string `json:"@ref"`
	Href string `json:"@href"`
	Type string `json:"@type,omitempty"`
}

Link represents a link in the response

type Pages

type Pages struct {
	First string `json:"first"`
	Last  string `json:"last"`
}

Pages represents page information for a result

type Query

type Query struct {
	Authors []string
	Title   string
}

https://dev.elsevier.com/sd_article_meta_tips.html

type ResponseAuthor added in v0.2.0

type ResponseAuthor struct {
	Order int
	Name  string
}

type SearchQuery

type SearchQuery struct {
	Authors string `json:"authors"`
	Title   string `json:"title"`
	Pub     string `json:"pub"` // Title of a journal or book
}

type SearchResponse

type SearchResponse struct {
	ResultsFound int             `json:"resultsFound"`
	Results      []*SearchResult `json:"results"`
	Message      string          `json:"message"`
}

SearchResponse represents the top-level API response

type SearchResult

type SearchResult struct {
	Authors         []ResponseAuthor `json:"authors"`
	DOI             string           `json:"doi"`
	LoadDate        string           `json:"loadDate"`
	OpenAccess      bool             `json:"openAccess"`
	Pages           Pages            `json:"pages"`
	PII             string           `json:"pii"`
	PublicationDate string           `json:"publicationDate"`
	SourceTitle     string           `json:"sourceTitle"`
	Title           string           `json:"title"`
	URI             string           `json:"uri"`
	VolumeIssue     string           `json:"volumeIssue"`
}

SearchResult represents a single search result item

func (*SearchResult) ToString added in v0.2.0

func (sr *SearchResult) ToString() string

Jump to

Keyboard shortcuts

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