{"id":21413829,"url":"https://github.com/mat1g3r/python-trivia-api","last_synced_at":"2025-07-14T03:31:33.553Z","repository":{"id":57457654,"uuid":"91295527","full_name":"MaT1g3R/Python-Trivia-API","owner":"MaT1g3R","description":"An API wrapper for https://opentdb.com/","archived":false,"fork":false,"pushed_at":"2017-07-15T10:10:35.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-19T00:48:34.959Z","etag":null,"topics":["api","api-wrapper","trivia","trivia-game","trivia-quiz","trivia-quiz-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaT1g3R.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T04:36:02.000Z","updated_at":"2023-04-29T08:06:12.000Z","dependencies_parsed_at":"2022-09-06T02:00:57.088Z","dependency_job_id":null,"html_url":"https://github.com/MaT1g3R/Python-Trivia-API","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2FPython-Trivia-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2FPython-Trivia-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2FPython-Trivia-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2FPython-Trivia-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaT1g3R","download_url":"https://codeload.github.com/MaT1g3R/Python-Trivia-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225943385,"owners_count":17549195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-wrapper","trivia","trivia-game","trivia-quiz","trivia-quiz-game"],"created_at":"2024-11-22T18:20:19.721Z","updated_at":"2024-11-22T18:20:20.362Z","avatar_url":"https://github.com/MaT1g3R.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Trivia API\n## Install\n```\npip install Python-Trivia-API\n```\n\n## Example usage\n```Python\nfrom pytrivia import Category, Diffculty, Type, Trivia\nmy_api = Trivia(True)\nresponse = my_api.request(2, Category.Books, Diffculty.Hard, Type.True_False)\nprint(response)\n```\n\n## Full method signature\n```Python\ndef request(self, num_questions: int, category: Category = None,\n            diffculty: Diffculty = None, type_: Type = None):\n    \"\"\"\n    Send an api request to https://opentdb.com/\n    Limitations:\n    Only 1 Category can be requested per API Call.\n    To get questions from any category, don't specify a category.\n    A Maximum of 50 Questions can be retrieved per call.\n\n    :param num_questions: the number of questions,\n    must be between 1 and 50 (inclusive)\n\n    :param category: the category of the question. None for any category\n\n    :param diffculty: the diffculty of the question. None for any diffculty\n\n    :param type_: the type of the question. None for any type\n\n    :return: the api call response\n\n    :rtype: dict\n\n    :raises: ValueError when the num_questions parameter is less than 1\n    or greater than 50\n    \"\"\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat1g3r%2Fpython-trivia-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmat1g3r%2Fpython-trivia-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat1g3r%2Fpython-trivia-api/lists"}