Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zastinian/stackoverflowapi
An api to collect questions from stackoverflow
https://github.com/zastinian/stackoverflowapi
api express overflow stack stack-overflow stackoverflow stackoverflow-api stackoverflow-questions stackoverflowapi
Last synced: 5 days ago
JSON representation
An api to collect questions from stackoverflow
- Host: GitHub
- URL: https://github.com/zastinian/stackoverflowapi
- Owner: Zastinian
- Created: 2023-06-30T02:09:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-13T02:33:58.000Z (over 1 year ago)
- Last Synced: 2024-11-07T04:59:50.952Z (about 2 months ago)
- Topics: api, express, overflow, stack, stack-overflow, stackoverflow, stackoverflow-api, stackoverflow-questions, stackoverflowapi
- Language: JavaScript
- Homepage: https://hedystia.com
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StackOverflowApi
## Links:
- [Discord Bot](https://hedystia.com/invite) You need `Administrator` permission to enter the dashboard
- [Discord](https://hedystia.com/support)
- [Website](https://hedystia.com/)## app
Creates an instance of the Express application.
### Returns
- {Object} - The Express application object.
## getQuestions(tag, page_number)
Retrieves a list of questions from a website based on the specified tag and page number.
### Parameters
- {string} tag - The tag to filter the questions by.
- {number} page_number - The page number of the questions to retrieve.### Returns
- {Promise>} - A promise that resolves to an array of question objects, each containing an ID.
## getQuestionAndAnswerById(questionId)
Retrieves a question and its corresponding answer from a website based on the provided question ID.
### Parameters
- {number} questionId - The ID of the question to retrieve.
### Returns
- {Promise<{question: {title: string, body: string}, answer: {body: string}}>} - A promise that resolves to an object containing the question and answer.
## app.get("/")
Handles GET requests to the root endpoint ("/").
### Parameters
- {Object} req - The request object.
- {Object} res - The response object.## app.get("/api")
Handles a GET request to the "/api" endpoint. Retrieves questions based on the provided query parameters and returns a JSON response.
### Parameters
- {Object} req - The request object.
- {Object} res - The response object.## app.listen(port)
Starts the application server and listens for incoming requests on the specified port.
### Parameters
- {number} port - The port number to listen on.