University API
The University API provides information about universities in the United States and Canada. Free users can search by name or country - premium users have access to advanced filters including location, enrollment, faculty ratios, and tuition.
Checking API status...
/v1/university GET
https://api.api-ninjas.com/v1/university
Returns information about universities matching the provided filters. At least one filter parameter is required. Free users can use name or country - all other filters are premium-only.
Parameters
nameoptionalThe name of the university to search for. Can be a partial match (e.g., "Harvard" will match "Harvard University"). At least one filter parameter (excluding offset/limit) must be provided.
countryoptionalThe country to filter by. Must be
USAorCanada(case-insensitive). At least one filter parameter (excluding offset/limit) must be provided.cityoptional premium onlyThe city where the university is located.
stateoptional premium onlyThe state or province where the university is located.
min_faculty_ratiooptional premium onlyMinimum student-to-faculty ratio as a number (e.g.,
15for 15:1 ratio).max_faculty_ratiooptional premium onlyMaximum student-to-faculty ratio as a number (e.g.,
20for 20:1 ratio).min_enrolledoptional premium onlyMinimum number of enrolled students.
max_enrolledoptional premium onlyMaximum number of enrolled students.
min_tuitionoptional premium onlyMinimum annual tuition cost (in USD).
max_tuitionoptional premium onlyMaximum annual tuition cost (in USD).
offsetoptional premium onlyThe number of results to skip. Must be zero or a positive integer. Default is
0.limitoptional premium onlyThe maximum number of results to return. Must be between
1and30. Default is10for premium users, fixed at5for free users.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
Returns a JSON array of objects, each with the following properties:
nameThe full name of the university.
degree_typesAn array of degree types offered by the university (e.g., "Bachelor's degree", "Master's degree").
addressThe street address of the university.
cityThe city where the university is located.
stateThe state or province abbreviation where the university is located (e.g., "MA" for Massachusetts).
postal_codeThe postal/zip code of the university.
countryThe country where the university is located (e.g., "USA", "Canada").
countyThe county where the university is located.
timezoneThe timezone of the university location (e.g., "EST", "PST").
latitudeThe latitude coordinate of the university location.
longitudeThe longitude coordinate of the university location.
phoneThe contact phone number of the university.
emailThe contact email address of the university.
websiteThe official website URL of the university.
institution_typeThe type of institution (e.g., "Private (Not For Profit)", "Public").
yearsThe typical duration of undergraduate programs (e.g., "4 Years").
enrollmentThe number of enrolled students as a string.
student_faculty_ratioThe student-to-faculty ratio (e.g., "7 to 1").
tuitionThe annual tuition cost in USD.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/university?name=HarvardHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[
{
"name": "Harvard University",
"degree_types": [
"Associate's degree",
"Bachelor's degree",
"Postbaccalaureate certificate",
"Master's degree",
"Post-master's certificate"
],
"address": "Massachusetts Hall",
"city": "Cambridge",
"state": "MA",
"postal_code": "02138",
"country": "USA",
"county": "Middlesex",
"timezone": "EST",
"latitude": "42.3802",
"longitude": "-71.1347",
"phone": "(617) 495-1000",
"website": "http://www.harvard.edu/",
"institution_type": "Private (Not For Profit)",
"years": "4 Years",
"enrollment": "27651",
"student_faculty_ratio": "7 to 1"
}
]Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/university?name=Harvard&country=USA" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.