Thank you!
Hi,
I am starting a project that will investigate many phenotypes (100-200), and need summary statistics for each one. I am currently trying to use the GWAS catalog API to list all traits with GWAS summary statistics and then narrow exclude studies with samples sizes smaller than 100,000. The problem I am running into is that when using the GWAS catalog API to list all available traits it only lists about 20 traits. I was wondering if anyone else has run into this problem and may know a solution (or may know a different way to do this).
Thanks for any help! I have attached some of my code below
# import packages
import requests
import json
# set URL for GWAS Catalog summary statistics
gwasURL = "https://www.ebi.ac.uk/gwas/summary-statistics/api/traits/"
# request all available traits
trait_res = requests.get(gwasURL)
1 answer
Hi,
Looking at their API docs, the default is to return 20 traits. However, you can adjust the start offset and the number that is returned in the URL. For example, this URL gets you 100 back https://www.ebi.ac.uk/gwas/summary-statistics/api/traits?size=100&start=0 .
Log in to answer this question.