Support for Web API #118
Unanswered
phanluchoaofficial1152
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am doing a graduation project and I need to use the api to get tidal song information for my project and of course I did not do anything to violate or affect the api but when I request I encounter this. Do you have a solution?
Thanks
`const express = require("express");
const axios = require("axios");
const Bottleneck = require("bottleneck");
const getAccessToken = require("../helpers/getTidalToken");
const router = express.Router();
const limiter = new Bottleneck({
maxConcurrent: 1,
minTime: 1000,
});
const throttledRequest = async (url, options) => {
return limiter.schedule(() => axios.get(url, options));
};
router.get("/search", async (req, res) => {
const { query, countryCode = "VN", include = "tracks,albums" } = req.query;
try {
let accessToken = await getAccessToken();
} catch (error) {
console.error(error.response?.data || error.message);
res
.status(500)
.json({
error: error.response || error.response?.data || "Search failed ...",
});
}
});
module.exports = router;`
Beta Was this translation helpful? Give feedback.
All reactions