{"id":21252429,"url":"https://github.com/scienceai/crossref","last_synced_at":"2025-07-11T01:32:46.316Z","repository":{"id":57210775,"uuid":"45635084","full_name":"scienceai/crossref","owner":"scienceai","description":"Client for the Crossref API","archived":false,"fork":false,"pushed_at":"2020-09-29T14:29:06.000Z","size":120,"stargazers_count":32,"open_issues_count":2,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-08T03:07:09.545Z","etag":null,"topics":["bibliography","publishing","science"],"latest_commit_sha":null,"homepage":"http://api.crossref.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scienceai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-05T19:43:57.000Z","updated_at":"2024-08-14T10:21:01.000Z","dependencies_parsed_at":"2022-08-31T05:02:24.671Z","dependency_job_id":null,"html_url":"https://github.com/scienceai/crossref","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scienceai%2Fcrossref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scienceai%2Fcrossref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scienceai%2Fcrossref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scienceai%2Fcrossref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scienceai","download_url":"https://codeload.github.com/scienceai/crossref/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225669684,"owners_count":17505386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibliography","publishing","science"],"created_at":"2024-11-21T03:47:28.959Z","updated_at":"2024-11-21T03:47:29.516Z","avatar_url":"https://github.com/scienceai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# crossref\n\nA client for the CrossRef API, for Node and browsers.\n\nThe [CrossRef API](http://api.crossref.org/) is relatively simple, but rolling access by hand is\nnever fun; and it has its little inconsistencies that can bite you. This thin module wraps it so\nthat you don't have to worry about that too much. (I say “too much” because it does not remove\ninconsistency down to the object level, e.g. things sometimes being `uri` and sometimes `URL`.)\n\n## Installation\n\nThe usual:\n\n    npm install --save crossref\n\n## API\n\nDetails for the API and the objects can be obtained from [the official CrossRef\ndocumentation](http://api.crossref.org/). It isn't very thorough (to say the least) but accessing\nvarious endpoints with `?sample=10` tacked onto the URL should give you a decent idea of what the\nobjects look like. (If you want to know which fields are optional and which are guaranteed to occur\nyou're out of luck, though, there is no documentation whatsoever — and I know no better).\n\nYou can load the CrossRef object like this:\n\n```js\nimport CrossRef from 'crossref';\n```\n\nIf you're somehow reading this before 2015, you can also do:\n\n```js\nvar CrossRef = require('crossref')\n```\n\nIn the browser you load `crossref.min.js`, then access the global `CrossRef` object.\n\nThis module exposes two types of methods: **item methods**, that only ever return one object, and\n**list methods** that return a list of objects followed by several bits of information that can be\nused to work with the list, notably with pagination. They differ in their callbacks:\n\n* The item method callbacks receive `(err, obj)` where `err` is an `Error` (if there was one), and\n  `obj` will be a simple JSON data structure.\n* The list method callbacks receive `(err, objects, nextOptions, isDone, message)`. That may seem\n  like a mouthful, but you rarely need them all. As usual `err` is an `Error` if there was one,\n  and `objects` is a list of simple JSON data structures. When you are paginating through the\n  results (which is not uncommon since CrossRef is a relatively large database) you will want to\n  use `nextOptions` and `isDone`. The former is an options object that captures the same search\n  options you passed to the method, but with the `offset` adjusted such that it will get the next\n  page. Basically, if you call the same method again with `nextOptions` you will get the next page\n  of the same query. And the latter is a boolean that is `true` if you have reached the last page.\n  Finally, `message` is just the list wrapper without its objects; it is only really useful if you\n  need some obscure metadata, for instance if you are doing a `facet` query (if you don't know what\n  that is you probably don't need it).\n\n### Root Listing Methods\n\nThese query the root endpoints from the CrossRef API and return a list. They all take an optional\n`options` object. If it is empty you just list everything, if it is defined it will translate to\nthe [API's parameters](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#parameters).\nOnly minimal process is done to map your JS object to the query string:\n\n* If you have a `query`, it is properly escaped.\n* You can specify `filter` as an object, and the correct string is built for you. If you want to\n  specify a given filter key multiple times to `OR` it, just put all the values in an array.\n* If you set `facet` to any truthy value it will come out as `facet=t`.\n\nOther options are just past through as key-value pairs. The options object can always be omitted.\nYou might want to be cautious with `options` on the `types()` method: the API tends to behave\ndifferently for that endpoint, and while we try to make it more consistent we probably haven't\ncaught everything yet.\n\nThe methods are [documented in the\nAPI](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#resource-components):\n\n* `CrossRef.works([options], listCB)`\n* `CrossRef.funders([options], listCB)`\n* `CrossRef.members([options], listCB)`\n* `CrossRef.types([options], listCB)`\n* `CrossRef.licenses([options], listCB)`\n* `CrossRef.journals([options], listCB)`\n\n### Item Methods\n\nThese methods retrieve a single item for a given key (or return an `Error` if not found). They are\n[documented in the\nAPI](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#resource-components-and-identifiers)\n\n* `CrossRef.work(doi, itemCB)`\n* `CrossRef.funder(funderID, itemCB)`\n* `CrossRef.prefix(doiPrefix, itemCB)`\n* `CrossRef.member(memberID, itemCB)`\n* `CrossRef.type(typeID, itemCB)`\n* `CrossRef.journal(issn, itemCB)`\n\n### Works Listing Methods\n\nThese methods are listing methods, but they list the works that correspond to a given item (e.g.\nthe works funded by a given funder). They all take a key like the item methods and optional\n`options`. They are [documented in the\nAPI](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#combining-resource-components).\n\n* `CrossRef.funderWorks(funderID, [options], listCB)`\n* `CrossRef.prefixWorks(doiPrefix, [options], listCB)`\n* `CrossRef.memberWorks(memberID, [options], listCB)`\n* `CrossRef.journalWorks(issn, [options], listCB)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscienceai%2Fcrossref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscienceai%2Fcrossref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscienceai%2Fcrossref/lists"}