0

If I run this query: https://api.data.gov/ed/collegescorecard/v1/schools?latest.school.city=Los Angeles&api_key=XXXXXXXXXXX, then the results look something like this: enter image description here

However, if I run this query: https://api.data.gov/ed/collegescorecard/v1/schools?latest.school.city=Los%20Angeles&latest.programs.cip_4_digit.code=1312&api_key=XXXXXXXXXX, then the results look something like this: enter image description here

Is there a way to run the second query so that the results are structured the same way that the results from the first query are structured?

2 Answers 2

0

Currently, this is how the API is intended to function with respect to four digit CIP codes. In order to support a legacy requirement, any query using programs.cip_4_digit will return the data in the dotted form.

If you need to transform this data back into a JSON object, you could use a library like dot-object to do this.

0

Thank you for your response.

I am currently working on an alternative solution that inserts &fields=... into the url. This yields a more consistent data set in terms of the structure.

An example might be: https://api.data.gov/ed/collegescorecard/v1/schools?fields=latest.school.name,latest.school.city,latest.school.state,latest.school.school_url,latest.school.price_calculator_url,latest.student.size,latest.student.grad_students,latest.cost.tuition.in_state,latest.cost.tuition.out_of_state&latest.school.city=Los%20Angeles&latest.programs.cip_4_digit.code=5206&api_key=XXXXXXXXXXXXXXXXXXX

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.