FAQ: Flashcard API Developer Documentation

Using this simple JSON API, you can find and download flashcard sets on Quizlet. For now, this API only returns publicly available sets, and cannot incorporate user credentials to view privately created sets. Results are regular JSON encoded UTF-8 strings, so pass\u00e9 represents passé. All the data you need (including terms inside a set via the extended=on parameter) is available via this API.

Remember, to use this API, you must agree to API terms of service and the API Branding Guidelines.

The API developer dashboard lets you obtain a developer key or see usage statistics for your application. You must be a registered Quizlet user to access this page.

This page documents version 1.0 of the Quizlet API.

The base URL for Quizlet’s Set API is
http://quizlet.com/api/1.0/sets

 

Request Parameters

Parameter Type / Options Description Default
dev_key string required The developer key you acquired here. None
q string required Defines the query used to search the Quizlet database. Any public set with a matching title or subjects will be returned. This search is case-insensitive.

You can use special prefixes to return sets that match things other than the title or subjects.

  • term:” gets all sets that have a term inside them that equals the query. For example, use “term:California” to get all sets that define California. Additionally, you can find sets that specify a term/definition pair (such as California and Sacramento). Use the query “term:california=sacramento” to find those sets.
  • creator:” The Quizlet username of a user. Use a query like “creator:jalenack” to return jalenack’s public sets.
  • ids:” A comma-separated list of set ID numbers (one or more). You might know set id numbers from previous searches or from the regular website, where an id can be pulled out of a set url: http://quizlet.com/415/ us-capitals-flash-cards.

You can combine prefixes and keyword searches, much the way you might query for “capitals site:quizlet.com” on Google. So to search for a set with “capitals” in its title which contains a “California” term and that was created by “jalenack”, you can use “capitals creator:jalenack term:california”; Multiple search types are considered an “AND” operation, meaning a result must match all conditions. Also, because the “term” prefix can include any characters, you should put it last.

None
callback string optional A javascript function name for use inside a web application, using the JSON-P method. callback=foo will wrap the response in the foo function: foo({...data...}) None
sort “most_studied”, “alphabetical”, “most_recent” optional Determines how to sort the results. “most_studied”
whitespace “on”, “off” optional Add this parameter (&whitespace=on) to properly indent and space the results for easier human reading of the raw results. This can make testing/debugging easier, and has no effect on the results. Without this parameter, Quizlet will minimize whitespace and network traffic. “off”
page integer optional The page offset. By default, search returns the first page of results, but you can get any page up to the maximum total_pages returned in any result set. 1 (one)
per_page integer optional The number of results to show per page. Minimum: 1 / Maximum: 50. 30
time_format “unix”, “fuzzy_date” optional Determines the formatting of timestamp types (currently only created). The default is a unix timestamp for maximum flexibility. Use “fuzzy_date” to display a human-friendly date that switches to “ago” (such as “3 days ago”) time if it’s recent or regular dates if it’s not. “unix”
extended “on”, “off” optional Adds the set description (description) and all the set’s terms (terms) to the set data displayed. You might do an initial search without extended=on, then use the ids: query prefix (on the q parameter) in a separate request to only get extended data on certain ids. “off”

Response Data

When you call the Quizlet Sets API, you will always receive a JSON object. This object will always contain a response_type which tells you if your query executed successfully. Its value can be either “ok” or “error”:

error

Key Value Description
response_type “error” If you get an “error” response_type, the query you specified could not be processed.
short_text string A short error message. This is the title of the message.
response_type string A more descriptive error message, usually one or two sentences.

ok

Key Value Description
response_type “ok” An “ok” response means there is useful data in the response. Yay!
total_results integer The number of sets matching your search.
page integer Shows which page of results you are viewing. 30 results are shown per page by default (adjust the per_page parameter to change that).
total_pages integer The total number of pages this result can display.
total_pages integer The number of pages this result has.
sets array An array of Set objects, as described below.

Set objects

A user creates a set to study a specific set of terms. A set is like a deck of flashcards. For example, a set titled “U.S. State Capitals” might have 50 terms, one for each state/capital pair. Use the extended=on parameter to download the full data of individual sets.

Key Value Description
id integer Quizlet’s universal ID for a set.
title string The title of the set, as supplied by the set’s creator. Be careful, this value is not html escaped.
url string The public URL of the Quizlet set. If the set’s title changes, the URL will change, but old URLs will properly make 301 Redirects. This string cannot contain HTML.
creator string The username of the person who created this set. Usernames are currently limited at 25 characters and cannot contain HTML. You can make a link to the user’s account by inserting their username link this: http://quizlet.com/user/**username here**/
created timestamp The time at which the set was created. By default, it is an integer unix timestamp. Use the time_format parameter to change how this value displays.
term_count integer The number of term/definition pairs in the set.
description string extended=on required The description of the set, as supplied by the set’s creator. Be careful, this value is not html escaped.
terms array extended=on required All the term/definition pairs for the set. The first item of each array is the term, and the second is the definition (i.e. ["term123","definition123"]). Be careful, these values are not html escaped.

Examples

Let’s try a simple search for “geography”:

Request

http://quizlet.com/api/1.0/sets?dev_key=a123&q=geography

Response

{
  "response_type": "ok",
  "total_results": 861,
  "page": 1,
  "total_pages": 18,
  "data": [
    {
      "id": 415,
      "title": "U.S. State Capitals",
      "creator": "jalenack",
      "created": 1144296408,
      "term_count": 49
    },
    {
      "id": 2285,
      "title": "World Capitals",
      "creator": "tenunda",
      "created": 1170106817,
      "term_count": 193
    },
    {
      "id": 277655,
      "title": "World Geography exam review",
      "creator": "aw1231",
      "created": 1210683453,
      "term_count": 41
    }
    ...more results...
  ]
}

Now something a little more complex. Let’s get the most recent sets by the user “jalenack” (including terms and definitions), and wrapped with a JSON-P callback processData().

Request

http://quizlet.com/api/1.0/sets?dev_key=a123&q=creator:jalenack&extended=on&sort=most_recent&callback=processData

Response

processData({
  "response_type": "ok",
  "total_results": 82,
  "page": 1,
  "total_pages": 2,
  "sets": [
    {
      "id": 732159,
      "title": "Demo Set",
      "url": "http:\/\/quizlet.com\/732159\/demo-set-flash-cards\/",
      "creator": "jalenack",
      "created": 1234641691,
      "term_count": 8,
      "description": "For showing Quizlet to others",
      "terms": [
        [
          "Mountain View",
          "Where is Google located?"
        ],
        [
          "Cambridge",
          "Where is MIT located?"
        ],
        [
          "Andrew Sutherland",
          "Who founded Quizlet?"
        ],
        [
          "California",
          "What state is below Oregon?"
        ],
        [
          "Barack Obama",
          "Who is the president of the USA?"
        ],
        [
          "Four",
          "What is two plus two?"
        ],
        [
          "Ten",
          "How many fingers do you have?"
        ],
        [
          "Quizlet",
          "What is this website called?"
        ]
      ]
    },
    {
      "id": 629186,
      "title": "XKCD metric speeds",
      "url": "http:\/\/quizlet.com\/629186\/xkcd-metric-speeds-flash-cards\/",
      "creator": "jalenack",
      "created": 1231145530,
      "term_count": 11,
      "description": "Via http:\/\/xkcd.com\/526\/",
      "terms": [
        [
          "5 kph",
          "walking"
		],
		...more results...
	   ]
	 }
  ]
});

Back to all FAQs »