2

I started playing with the API at https://api.data.gov/ed/collegescorecard/v1/schools

Querying a school by id

https://api.data.gov/ed/collegescorecard/v1/schools?id=238476&api_key=***

returns me a lot of information about it, but is there a way to get only a subset of this data without explicity write down all the fields in the _fields query param?

lets say I want all the data from "2013".

By doing

https://api.data.gov/ed/collegescorecard/v1/schools?id=238476&_fields=id,2013&api_key=***

I get field_not_found error.

Going deeper in the tree didn't help much. Let's say I'm intereted only in 2013.academics information. Querying

https://api.data.gov/ed/collegescorecard/v1/schools?id=238476&_fields=id,2013.academics&api_key=***

returns me the same field_not_found error.

2 Answers 2

2

V1 of the API is a GET API with /v1/schools as the endpoint.

The basic structure of an API call is year.dev-category.de-friendly-variable-name, except that the school category has no year and id, ope6_id, ope8_id and location have no category or year.

The subsetting that you wish to do can be done with explicit fields and is rich. For example

'https://api.data.gov/ed/collegescorecard/v1/schools?fields=school.name,id,2011.aid.median_debt.completers.overall,2011.repayment.1_yr_repayment.completers,2011.earnings.10_yrs_after_entry.working_not_enrolled.mean_earnings&page=100'

is powerful. You will need to list fields or subset locally.

1
  • Thank you for the answer, I guess I will subset locally only the data I need.
    – Todor
    Oct 21, 2015 at 6:37
1

Many apologies for the slow response here!

Unfortunately, specifying parent fields or wildcards isn't supported by the API, but we'd love to add that, and may do so soon. You can track it at this GitHub issue.

-- Yoz Grahame (Developer, CollegeScorecard Team @ 18F)

0

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.