Welcome to the Sports API documentation. This API provides information about sports news, including titles, publication dates, content, and more.
This API is designed to offer access to sports-related news articles. It supports pagination to allow users to navigate through the available data efficiently.
/api/sports/news/
GET
page
(optional): Page number for pagination. Default is 1.page_size
(optional): Number of items per page. Default is 10.const axios = require('axios');
const options = {
method: 'GET',
url: 'https://sportsdaily.p.rapidapi.com/api/sports/news/',
params: {
page: '1',
page_size: '15'
},
headers: {
'X-RapidAPI-Key': '230591214amsh0833b9d51efdf1fp164645jsn88c0132afe71',
'X-RapidAPI-Host': 'sportsdaily.p.rapidapi.com'
}
};
try {
const response = await axios.request(options);
console.log(response.data);
} catch (error) {
console.error(error);
}
Authentication
To use this API, you need to include the following headers in your request:
X-RapidAPI-Key: Your Rapid API key.
X-RapidAPI-Host: Hostname for the Rapid API service (sportsdaily.p.rapidapi.com).
Pagination
Pagination is supported using the page parameter in the query string. You can specify the page number to retrieve different sets of sports news.
Example for Page 2:
const options = {
method: 'GET',
url: 'https://sportsdaily.p.rapidapi.com/api/sports/news/',
params: { page: '2' },
headers: {
'X-RapidAPI-Key': 'YOUR_RAPID_API_KEY',
'X-RapidAPI-Host': 'sportsdaily.p.rapidapi.com'
}
};
Additional Notes
Ensure you have a valid Rapid API key for authentication.
Refer to the Rapid API documentation for any updates or changes.
Feel free to reach out for any questions or support related to this API.