evolgeniusteam / GMrepoProgrammableAccess

programmable access to GM repo
GNU General Public License v3.0
20 stars 12 forks source link

HTTP 500 error when fetching abundance through API #13

Closed clay-jona closed 10 months ago

clay-jona commented 1 year ago

Hi, I get an HTTP 500 error when getting data through Python API for certain projects. The following code is an example to reproduce this error.

import json
import requests

mesh_id = "D008103"
project_id = "PRJNA431746"
query = {"mesh_id": mesh_id, "project_id": project_id}

# Query data
url = 'https://gmrepo.humangut.info/api/getMicrobeAbundancesByPhenotypeMeshIDAndProjectID'
post_result = requests.post(url, data=json.dumps(query))

print(post_result)
# <Response [500]>
print(post_result.text == "")
# True
ZhuJiaying1998 commented 1 year ago

I apologize for the inconvenience. The data you requested exceeds the maximum memory limit on our server, which has led to the inability to retrieve the requested data. We recommend that you first obtain the corresponding run list and then use the “getAssociatedRunsByPhenotypeMeshIDLimit” API for batch downloading.