Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering not working via REST api #17

Open
nnn911 opened this issue Dec 12, 2024 · 0 comments
Open

Filtering not working via REST api #17

nnn911 opened this issue Dec 12, 2024 · 0 comments

Comments

@nnn911
Copy link

nnn911 commented Dec 12, 2024

Hi,

I'm trying to use the index rest api to read citations data using the example provided in the documentation:

import requests
url = "https://opencitations.net/index/api/v2/citations/doi:10.1186/1756-8722-6-59
response = requests.get(url)
print(response.json())

I get back 186 records:

[{'author_sc': 'no',
  'cited': 'omid:br/06190834283 doi:10.1186/1756-8722-6-59 '
           'openalex:W2120377900 pmid:23958373',
  'citing': 'omid:br/06101440095 doi:10.3390/molecules25092135 '
            'openalex:W3023096242 pmid:32370213',
  'creation': '2020-05-02',
  'journal_sc': 'no',
  'oci': '06101440095-06190834283',
  'timespan': 'P6Y8M13D'},
 {'author_sc': 'no',
  'cited': 'omid:br/06190834283 doi:10.1186/1756-8722-6-59 '
           'openalex:W2120377900 pmid:23958373',
  'citing': 'omid:br/06101524605 doi:10.1016/j.clim.2016.01.012 '
            'openalex:W2250687747 pmid:26821304',
  'creation': '2016-03',
  'journal_sc': 'no',
  'oci': '06101524605-06190834283',
  'timespan': 'P2Y6M'},...

If i now add a filter:

url = "https://opencitations.net/index/api/v2/citations/doi:10.1186/1756-8722-6-59?filter=date:>2020" 

I get back the same 186 records, even though most of them have creation days before 2020.

Am I using the API wrong or is this a bug in the backend?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant