RTICWDT/open-data-maker

Location based query returns Internal Server Error

gopala000 opened this issue · 1 comments

I tried to retrieve universities in a 100 miles radius for a given zip and I get "Internal Server Error". Is there anything I missed in below API call? Another issue is I get no results, if I give multiple cip codes like latest.programs.cip_4_digit.code=1101,1107. Is it not supported?

https://api.data.gov/ed/collegescorecard/v1/schools?api_key=&latest.programs.cip_4_digit.code=1101&latest.programs.cip_4_digit.credential.level=2,3&fields=latest.programs.cip_4_digit.unit_id,latest.programs.cip_4_digit.school.name,latest.programs.cip_4_digit.code,latest.programs.cip_4_digit.title,latest.programs.cip_4_digit.earnings.median_earnings,latest.programs.cip_4_digit.debt.median_debt&sort=latest.programs.cip_4_digit.earnings.median_earnings:desc&per_page=100&zip=98005&distance=100mi

Hello,
Adding a distance calculation currently requires at least one field from the institution level data present during the query. Also, The distance metric of miles is implied and expects an integer value.

Here is my adjusted query:

https://api.data.gov/ed/collegescorecard/v1/schools?api_key=API_KEY
&latest.programs.cip_4_digit.code=1101
&latest.programs.cip_4_digit.credential.level=2,3
&fields=latest.programs.cip_4_digit.unit_id,latest.programs.cip_4_digit.school.name,latest.programs.cip_4_digit.code,latest.programs.cip_4_digit.title,latest.programs.cip_4_digit.earnings.median_earnings,latest.programs.cip_4_digit.debt.median_debt
&sort=latest.programs.cip_4_digit.earnings.median_earnings:desc
&per_page=100
&zip=98005
&distance=100
&latest.student.size__range=0..

I added latest.student.size__range=0.. as the required institution level field but others can be used if additional functionality is required. For example adding school.operating=1 will ensure that the data returned from the API only show schools that are currently operating.

Querying value lists of program data such as latest.programs.cip_4_digit.code=1101,1107 is not currently supported.

Lastly, I am going to transfer this item to the Open Data Maker repository and for tracking in the appropriate categories. There should be a more graceful error handling of this particular error.