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

Can't use commas in title.search #254

Open
hughjonesd opened this issue Jun 17, 2024 · 1 comment
Open

Can't use commas in title.search #254

hughjonesd opened this issue Jun 17, 2024 · 1 comment
Labels

Comments

@hughjonesd
Copy link

The following code returns with a 403 error from openalex:

oa_fetch(title.search = "Hello, John", entity = "works")
Error: OpenAlex API request failed [403]
Invalid query parameters error.
<Invalid query parameter in  John.>

Using title.search = "\"Hello, John\"" gives the same error. So does pre-encoding it with utils::URLencode(). The openalex documentation isn't clear how to encode commas in search filters, so I'm not sure how to fix this.

Using search = "\"Hello, John\"" works OK, but this searches the abstract as well as the title.

@trangdata
Copy link
Collaborator

Thank you for reporting this @hughjonesd. You're right, the comma is currently reserved for separating the filters in the query. search = "\"Hello, John\"" works because in that case you're using search, not filter. The OpenAlex team is aware of this issue and hope to address it soon.

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

No branches or pull requests

2 participants