{"id":17644991,"url":"https://github.com/actuallyconnor/trivious","last_synced_at":"2026-02-04T22:36:09.663Z","repository":{"id":41713976,"uuid":"235879613","full_name":"ActuallyConnor/Trivious","owner":"ActuallyConnor","description":"A publicly available trivia API created with Laravel and PHP web scraping. The API is based on jService.io. With a total of 96,221 questions I plan on creating various applications to leverage this API in the future. Try it yourself now!","archived":false,"fork":false,"pushed_at":"2024-10-22T17:35:33.000Z","size":11598,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T03:45:26.664Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://trivia.connorsmyth.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ActuallyConnor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-23T20:24:40.000Z","updated_at":"2024-10-22T17:35:37.000Z","dependencies_parsed_at":"2024-06-19T23:13:04.243Z","dependency_job_id":"65890e93-c0ad-4ea8-b2ff-4aa617ccf44c","html_url":"https://github.com/ActuallyConnor/Trivious","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ActuallyConnor/Trivious","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyConnor%2FTrivious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyConnor%2FTrivious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyConnor%2FTrivious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyConnor%2FTrivious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActuallyConnor","download_url":"https://codeload.github.com/ActuallyConnor/Trivious/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyConnor%2FTrivious/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29098239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T21:05:08.033Z","status":"ssl_error","status_checked_at":"2026-02-04T21:04:53.031Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hacktoberfest"],"created_at":"2024-10-23T10:44:18.193Z","updated_at":"2026-02-04T22:36:09.641Z","avatar_url":"https://github.com/ActuallyConnor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trivia API\n\n## Online Documentation\n[https://trivia.connorsmyth.com/api](https://trivia.connorsmyth.com/api)\n\n## About\n\n### 96,221 QUESTIONS\n\nI started creating this trivia API when I decided to create a trivia slack app. At first I was leveraging a different API that contained only user submitted questions. The issue I found with it was it had only the option for true or false questions or multiple choice. I wanted something that was more of along the lines of single question and single answer. I didn't want the question not to work without the other multiple choice options.\n\nI began looking around for a different trivia api and came across [jService.io](http://jservice.io/), a ruby based trivia API with 156,800 questions built by scraping jArchive. After poking around a little I discovered that it was being hosted on a simple heroku server with many outdated Ruby dependencies. I attempted to replicate the Ruby environment on my local machine and a simple Linode server with no success, even with rvm. I noticed the developer hasn't had much of an online presence in the last 5 years so after attempting to reach out with and receiving no response I decided to create my own trivia API.\n\nUpon noticing that jService kept track of questions marked as invalid and also had many questions with empty questions or answers fields. I built a quick PHP script and began scraping away. I then created another PHP script after evaluating the state of the database and cleaned up the invalid questions and sent it to a developer/mentor friend who was curious, [Jordana Harrison](http://jordanaharrison.com/). They helped me do some further cleaning and created a new table that handled the relationships between the category names and the category IDs.\n\nThen I started to create the API with Laravel. I am a big fan of the open source movement so I didn't want to bog people down with having to use API keys, similar to the way jService works. The API is free and open to the public.\n\n## Install the Project\n```shell script\n$ git clone https://github.com/ActuallyConnor/Trivious.git\n$ cd Trivious\n$ composer install\n$ npm install\n$ php artisan serve\n```\nThen go to [http://127.0.0.1:8000](http://127.0.0.1:8000)*\n\n_*Optionally, if you are using Valet you can go to [http://trivious.test](http://trivious.test)_\n\n## API Usage\n\n### /QUESTION\nURL: /api/question\n\nDefault: the default return is a random question\n\nOptions:\n- id(int): the question with the specified id\n- value(int): a random question of the specified value\n- category(string): a random question from the specified category\n- airdate(string): a random question from the specified air date\n- year(int): a random question from the specified year\n- month(int): a random question from the specified month\n- day(int): a random question from the specified day\n\nExample: https://trivia.connorsmyth.com/api/question/?id=6\n\nExample: https://trivia.connorsmyth.com/api/question/?value=200\u0026category=music\n\n### /QUESTIONS\nURL: /api/questions\n\nDefault: the default return is a group of 100 questions starting with an id of 1 and ending with an id of 100\n\nOptions:\n- value(int): all questions of the specified value\n- category(string): all questions from the specified category\n- airdate(string): all questions from the specified air date\n- year(int): all questions from the specified year\n- month(int): all questions from the specified month\n- day(int): all questions from the specified day\n- offset(int): all questions starting from a specified offset number\n- quantity(int): limit the number of questions that can be returned\n\nExample: https://trivia.connorsmyth.com/api/questions/?value=200\u0026category=sports\n\n### /QUESTION/TODAY\nURL: /api/question/today\n\n\nDefault: the default return is a random question that aired on today's date from any year\n\nOptions:\n- value(int): a random question from today's date of the specified value\n- category(string): a random question from today's date from the specified category\n\n### /QUESTIONS/TODAY\nURL: /api/questions/today\n\nDefault: the default all questions that aired on today's date from any year\n\nOptions:\n- value(int): all questions from today's date of the specified value\n- category(string): all questions from today's date from the specified category\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factuallyconnor%2Ftrivious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factuallyconnor%2Ftrivious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factuallyconnor%2Ftrivious/lists"}