0

I am using the url below to query in a Java Program:

https://api.data.gov/ed/collegescorecard/v1/schools.json?school.degrees_awarded.predominant=2,3&_fields=id,school.name=boston%20college,2017.student.size,2017.school.degree_urbanization,2017.admissions.admission_rate.overall,2017.admissions.sat_scores.average.overall&api_key=*****

However, I keep getting the error:

Server returned HTTP response code: 400 for URL

Not sure if anyone could help.

1 Answer 1

3

There are a few tweaks needed to get this query in shape.

  • The schools endpoint does not need to have the extension .json added to it. The API returns json by default, so that was the cause of the 404 error.

  • When filtering, such as you are on school name, those values need to be specified as part of the main query statement, and not part of the _fields parameter.

  • The latest data available is from 2016 instead of 2017.

I have rewritten your query below so you can see these differences:

https://api.data.gov/ed/collegescorecard/v1/schools?school.name=boston%20college&school.degrees_awarded.predominant=2,3&_fields=id,school.name,2016.student.size,school.degree_urbanization,2016.admissions.admission_rate.overall,2016.admissions.sat_scores.average.overall&api_key=****

Also, API keys should be thought of as passwords and not posted or shared publically. I have removed it from your post and my response. If you reach out to the College Scorecard helpdesk, we can help set you up with a new key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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