1
$\begingroup$

Is there a limit of query results on RCSB API?

Interestingly, no matter how to adjust my query criteria, only 10 assemblies are returned. Here is an example query json: (truncated from a longer query file)

{
  "query": {
    "type": "group",
    "logical_operator": "and",
    "nodes": [
      {
        "type": "terminal",
        "service": "text",
        "parameters": {
          "operator": "greater",
          "value": 1,
          "attribute": "rcsb_assembly_info.polymer_entity_instance_count"
        }
      }
    ]
  },
  "return_type": "assembly"
}

Example python code requesting query:

url_query = 'https://search.rcsb.org/rcsbsearch/v1/query?json='
query_str = open(query_json, 'r').read()
query_str = query_str.replace('\n', '').replace(' ', '')
url = url_query + query_str

r = requests.get(url)
content = r.content.decode('utf-8')
result = json.loads(content)
print(len(result['result_set']) # always equal to 10
$\endgroup$
1
2
$\begingroup$

Staff from rcsb kindly reminds me the solution - add the following lines in the json query.

"request_options": {
"return_all_hits": true
}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.