Questions

Questions' endpoints.

All APIs are totally FREE & NO API KEY REQUIRED

All Questions GET

This endpoinst used to get questions

Endpoint

/api/v1/questions

Query Params

QueryDescriptionPossible ValuesDefault valuetype
page*Number of desired questionsranges from 1 to totalPages-integer
limit*Number of desired questionsranges from 1 to 50-integer
langLanguage of desired questions‘en’ or ‘ar’'en'string
topicTopic of desired questionse.g 'Music', see list of topics-string
Fields marked with * are required

Example request

api/v1/questions?limit=20&page=1&topic=Advanced math

Example response

{
    "success": true,
    "result": {
        "docs": [
            {
                "_id": "613f377600f6d00004800be5",
                "lang": "en",
                "text": "3^(4)÷3^(2) = ",
                "topic": {
                    "_id": "610ef0d2a4528a2ad8a98d51",
                    "lang": "en",
                    "name": "Advanced math",
                    "category": {
                        "_id": "610eac9f1ccd1c1e3bef738a",
                        "lang": "en",
                        "name": "Math",
                        "createdAt": "2021-08-07T15:54:07.684Z",
                        "updatedAt": "2021-08-07T15:54:07.684Z"
                    },
                    "createdAt": "2021-08-07T20:45:06.861Z",
                    "updatedAt": "2023-12-01T11:36:36.112Z",
                    "img": "https://res.cloudinary.com/quizat/image/upload/v1638963888/topic/610ef0d2a4528a2ad8a98d51.png"
                },
                "difficulty": 2,
                "options": [
                    {
                        "isRightAnswer": true,
                        "_id": "613f377600f6d00004800be6",
                        "text": "9"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f377600f6d00004800be7",
                        "text": "3"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f377600f6d00004800be8",
                        "text": "1"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f377600f6d00004800be9",
                        "text": "12"
                    }
                ],
                "createdAt": "2021-09-13T11:35:19.008Z",
                "updatedAt": "2021-09-13T11:35:19.008Z"
            },
            {
                "_id": "613f380100f6d00004800c00",
                "lang": "en",
                "text": "What is |-26|?",
                "topic": {
                    "_id": "610ef0d2a4528a2ad8a98d51",
                    "lang": "en",
                    "name": "Advanced math",
                    "category": {
                        "_id": "610eac9f1ccd1c1e3bef738a",
                        "lang": "en",
                        "name": "Math",
                        "createdAt": "2021-08-07T15:54:07.684Z",
                        "updatedAt": "2021-08-07T15:54:07.684Z"
                    },
                    "createdAt": "2021-08-07T20:45:06.861Z",
                    "updatedAt": "2023-12-01T11:36:36.112Z",
                    "img": "https://res.cloudinary.com/quizat/image/upload/v1638963888/topic/610ef0d2a4528a2ad8a98d51.png"
                },
                "difficulty": 2,
                "options": [
                    {
                        "isRightAnswer": true,
                        "_id": "613f380100f6d00004800c01",
                        "text": "-26"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f380100f6d00004800c02",
                        "text": "26"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f380100f6d00004800c03",
                        "text": "0"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f380100f6d00004800c04",
                        "text": "1"
                    }
                ],
                "createdAt": "2021-09-13T11:37:37.927Z",
                "updatedAt": "2021-09-13T11:37:37.927Z"
            },
            {
                "_id": "613f383b00f6d00004800c09",
                "lang": "en",
                "text": "(x – 4)(x + 5) =",
                "topic": {
                    "_id": "610ef0d2a4528a2ad8a98d51",
                    "lang": "en",
                    "name": "Advanced math",
                    "category": {
                        "_id": "610eac9f1ccd1c1e3bef738a",
                        "lang": "en",
                        "name": "Math",
                        "createdAt": "2021-08-07T15:54:07.684Z",
                        "updatedAt": "2021-08-07T15:54:07.684Z"
                    },
                    "createdAt": "2021-08-07T20:45:06.861Z",
                    "updatedAt": "2023-12-01T11:36:36.112Z",
                    "img": "https://res.cloudinary.com/quizat/image/upload/v1638963888/topic/610ef0d2a4528a2ad8a98d51.png"
                },
                "difficulty": 2,
                "options": [
                    {
                        "isRightAnswer": true,
                        "_id": "613f383b00f6d00004800c0a",
                        "text": "x2 + x - 20"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f383b00f6d00004800c0b",
                        "text": "x2 - x - 20"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f383b00f6d00004800c0c",
                        "text": "x2 - 4x - 20"
                    },
                    {
                        "isRightAnswer": false,
                        "_id": "613f383b00f6d00004800c0d",
                        "text": "x2 + 5x - 20"
                    }
                ],
                "createdAt": "2021-09-13T11:38:35.692Z",
                "updatedAt": "2021-09-13T11:38:35.692Z"
            }
        ],
        "totalDocs": 88,
        "limit": 3,
        "totalPages": 30,
        "page": 1,
        "pagingCounter": 1,
        "hasPrevPage": false,
        "hasNextPage": true,
        "prevPage": null,
        "nextPage": 2
    }
}

Random Questions GET

This endpoinst used to get random questions.

Endpoint

/api/v1/questions/random

Query Params

QueryDescriptionPossible ValuesDefault valuetype
limit*Number of desired questionsranges from 1 to 50-integer
langLanguage of desired questions‘en’ or ‘ar’'en'string
topicTopic of desired questionse.g 'Advanced math', see list of topics-string
Fields marked with * are required

Example request

api/v1/questions/random?limit=3&lang=en&topic=Medicine

Example response

{
    "success": true,
    "que": [
        {
            "_id": "612f70cc4daddc000481b601",
            "deleted": false,
            "approved": true,
            "lang": "en",
            "text": "The Flag of the European Union has how many stars on it?",
            "topic": "612e9bbed49d4c00042c80ae",
            "difficulty": 1,
            "options": [
                {
                    "isRightAnswer": true,
                    "_id": "612f70cc4daddc000481b602",
                    "text": "12"
                },
                {
                    "isRightAnswer": false,
                    "_id": "612f70cc4daddc000481b603",
                    "text": "10"
                },
                {
                    "isRightAnswer": false,
                    "_id": "612f70cc4daddc000481b604",
                    "text": "14"
                },
                {
                    "isRightAnswer": false,
                    "_id": "612f70cc4daddc000481b605",
                    "text": "16"
                }
            ],
            "ratings": [],
            "reports": [],
            "createdAt": "2021-09-01T12:23:40.699Z",
            "updatedAt": "2021-09-01T12:23:40.699Z",
            "__v": 0
        }
    ]
}

Report Question POST

This endpoinst used to report a question.

Endpoint

/api/v1/questions/report

Body

QueryDescriptionType
id*Question’s _idstring
reason*A brief explanation about the report, maximum 150 charactersstring
Fields marked with * are required

Example request

/api/v1/questions/report
body: {
    id: "612f70cc4daddc000481b601",
    reason: "The question has duplicated answers"
}

Example response

{
    "success": true,
    "msg": "Report has been added successfully"
}