A simple npm package to interact with Vinted.
You can install this package using npm:
npm install @eliottoblinger/vinted
import { Vinted } from '@eliottoblinger/vinted';
const vintedInstance = new Vinted();
// Set proxies if needed
vintedInstance.setProxies(['proxy1', 'proxy2']);
// Get available brands
const brands = await vintedInstance.getBrands();
console.log('Available brands:', brands);
// Perform a search
const searchOptions = {
minPrice: 10,
maxPrice: 50,
limitPerPage: 10,
// other options...
};
const searchResults = await vintedInstance.search({
text: 'your search text',
options: searchOptions,
});
console.log('Search Results:', searchResults.results);
console.log('Number of Pages:', searchResults.numberOfPages);
console.log('Current Page:', searchResults.currentPage);
console.log('Has Next Page:', searchResults.hasNext);
// Paginate through results
while (searchResults.hasNext) {
await searchResults.next();
console.log('Next Page Results:', searchResults.results);
}
Creates a new Vinted instance.
Sets the proxies for the Vinted instance.
Gets the available brands.
Performs a search with the specified text and options.
- Parameters:
text
(string): The search text.options
(object):minPrice
(number, optional): Minimum price filter.maxPrice
(number, optional): Maximum price filter.limitPerPage
(number, optional): Results per page.brandsIds
(array, optional): Array of brand IDs.orderBy
(string, optional): Sorting order.userId
(string, optional): User ID for user-specific searches.
Moves to the next page of search results.
When setting proxies using the setProxies
method, ensure that they are provided in the following format:
"{protocol}://{username}:{password}@{address_ip}:{port}"
For example:
const vintedInstance = new Vinted();
// Set proxies with authentication
vintedInstance.setProxies([
"http://user1:pass1@proxy1.example.com:8080",
"https://user2:pass2@proxy2.example.com:8080",
"socks5://user3:pass3@proxy3.example.com:8080",
]);