NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.7)

From 10,194 users

500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
220ms230ms292ms460ms1086ms

Didn't find what you were looking for? Suggest an improvement


/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

  • name  optional

    The 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.

  • country  optional

    The country to filter by. Must be USA or Canada (case-insensitive). At least one filter parameter (excluding offset/limit) must be provided.

  • city  optional premium only

    The city where the university is located.

  • state  optional premium only

    The state or province where the university is located.

  • min_faculty_ratio  optional premium only

    Minimum student-to-faculty ratio as a number (e.g., 15 for 15:1 ratio).

  • max_faculty_ratio  optional premium only

    Maximum student-to-faculty ratio as a number (e.g., 20 for 20:1 ratio).

  • min_enrolled  optional premium only

    Minimum number of enrolled students.

  • max_enrolled  optional premium only

    Maximum number of enrolled students.

  • min_tuition  optional premium only

    Minimum annual tuition cost (in USD).

  • max_tuition  optional premium only

    Maximum annual tuition cost (in USD).

  • offset  optional premium only

    The number of results to skip. Must be zero or a positive integer. Default is 0.

  • limit  optional premium only

    The maximum number of results to return. Must be between 1 and 30. Default is 10 for premium users, fixed at 5 for free users.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, or an error if the request is unsuccessful. Not every field is returned for every university — fields marked optional below are only included when data is available for that particular record.

  • name

    The full name of the university.

  • degree_types  optional

    An array of degree types offered by the university (e.g., "Bachelor's degree", "Master's degree").

  • address  optional

    The street address of the university.

  • city

    The city where the university is located.

  • state

    The state or province abbreviation where the university is located (e.g., "MA" for Massachusetts).

  • postal_code  optional

    The postal/zip code of the university.

  • country  optional

    The country where the university is located (e.g., "USA", "Canada").

  • county  optional

    The county where the university is located.

  • timezone  optional

    The timezone of the university location (e.g., "EST", "PST").

  • latitude  optional

    The latitude coordinate of the university location.

  • longitude  optional

    The longitude coordinate of the university location.

  • phone

    The contact phone number of the university.

  • email  optional

    The contact email address of the university. Only returned for some records.

  • website

    The official website URL of the university.

  • institution_type

    The type of institution (e.g., "Private (Not For Profit)", "Public").

  • years  optional

    The typical duration of undergraduate programs (e.g., "4 Years").

  • enrollment  optional

    The number of enrolled students as a string.

  • student_faculty_ratio  optional

    The student-to-faculty ratio (e.g., "7 to 1").

  • tuition  optional

    The annual tuition cost in USD. Only returned for records where tuition data is available; frequently omitted.

Sample Request Live Demo!

name
country

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/university?name=Harvard

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      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.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the University API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The University API returns information about universities in the United States and Canada; you can filter results by setting the country parameter to either USA or Canada (case-insensitive). To look up cities or countries more broadly, see the related City API and Country API.
  • Pass the name parameter, which supports partial matches (for example, 'Harvard' will match 'Harvard University'), and at least one filter parameter must be provided. Free users can search by name or country, while advanced filters require a premium plan.
  • Each result is a JSON object with fields such as name, degree_types, address, city, state, country, latitude, longitude, website, institution_type, enrollment, student_faculty_ratio, and tuition; on a failed request you instead receive an error.
  • Yes, premium users can use advanced filters including city, state, min_enrolled, max_enrolled, min_tuition, max_tuition, min_faculty_ratio, and max_faculty_ratio, plus offset and limit for pagination; these require a premium plan, which you can start by registering.