-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi there!
The index API documentation mentions the filter date as a way to retrieve results based on date:
Line 208 in aca3d23
| 2. `filter=<field_name>:<operator><value>`: only the rows compliant with `<value>` are kept in the result set. The parameter `<operation>` is not mandatory. If `<operation>` is not specified, `<value>` is interpreted as a regular expression, otherwise it is compared by means of the specified operation. Possible operators are "=", "<", and ">". For instance, `filter=title:semantics?` returns all the rows that contain the string "semantic" or "semantics" in the field `title`, while `filter=date:>2016-05` returns all the rows that have a `date` greater than May 2016. |
However, this does not work, as date is not a valid field (note that the required filter pattern should be filter=<field_name>:<operator><value> ).
This should actually be changed to creation which is the actual field name containing the creation date.
For reference, here is an example:
(1) Filter by date:
Request URL:
https://api.opencitations.net/index/v2/citations/doi:10.1093/nar/gkt006?filter=date:%3E2020
First result:
{
"oci": "061902621438-061501344591",
"citing": "omid:br/061902621438 doi:10.1038/srep34838 openalex:W2529308621 pmid:27708423",
"cited": "omid:br/061501344591 doi:10.1093/nar/gkt006 openalex:W2048194168 pmid:23335781",
"creation": "2016-10-06",
"timespan": "P3Y8M19D",
"journal_sc": "no",
"author_sc": "no"
},
(2) Filter by creation:
Request URL:
https://api.opencitations.net/index/v2/citations/doi:10.1093/nar/gkt006?filter=creation:%3E2020
First result:
{
"oci": "061702215634-061501344591",
"citing": "omid:br/061702215634 doi:10.7717/peerj.8548 openalex:W3005728317 pmid:32095365",
"cited": "omid:br/061501344591 doi:10.1093/nar/gkt006 openalex:W2048194168 pmid:23335781",
"creation": "2020-02-12",
"timespan": "P7Y0M26D",
"journal_sc": "no",
"author_sc": "no"
},
Metadata
Metadata
Assignees
Labels
No labels