GithubHelp home page GithubHelp logo

druv5319 / sneaks-api Goto Github PK

View Code? Open in Web Editor NEW
439.0 33.0 119.0 55.27 MB

A StockX, FlightClub, Goat, and Stadium Goods API all in one. This sneaker API allows users to search sneakers and track and compare prices while providing additional info such as product links and images

JavaScript 100.00%
sneakers stockx api shoes yeezy

sneaks-api's Introduction

A StockX API, FlightClub API, Goat API, and Stadium Goods API all in one.

Sneaks API is a sneaker API built using Node.JS, Express, and Got. The Sneaks API allows users to get essential sneaker content such as images, product links and even prices from resell sites while also collecting data and storing it within a database. This API mainly scrapes StockX for sneaker information and then asynchronously scrapes Stadium Goods, Goat, and Flight Club for additional sneaker information such as images and its respective resell price. This API outputs a sneaker object of the following variables:

UPDATE 1.2.3: Updated and fixed the Goat API to reflect their API changes. Removed the web server (localhost:4000) the package creates.

  • Sneaker Name
  • Colorway
  • Description
  • Release Date
  • Retail Price
  • Style ID
  • Image Links
  • Product links from each of the resell sites
  • Price map (of shoe size to price) from each of the resell sites
  • And more

I built this API so sneaker heads and developers are able to create sneaker based programs, trackers and websites without having to fumble with scrapping information on all 4 resell websites. Feel free to fork, edit and submit a pull request for this API for any changes or improvements. If you have any questions or issues regarding this feel free to create an issue and I will try to answer them as soon as I can.

Demo

Sneaks App - Github

Twilio Blog Tutorial: Build a Sneaker Price Tracker with Twilio Programmable SMS

Technologies Used

  • Node.JS
  • Express
  • Got
  • Request
  • Mongoose

Installation

To use this API you will need to have node.js installed. Once installed, use this line on the terminal within your Node.js project directory

npm install sneaks-api

and place this line at the top of your main file

const SneaksAPI = require('sneaks-api');

How to Use

const SneaksAPI = require('sneaks-api');
const sneaks = new SneaksAPI();

//getProducts(keyword, limit, callback) takes in a keyword and limit and returns a product array 
sneaks.getProducts("Yeezy Cinder", 10, function(err, products){
    console.log(products)
})

//Product object includes styleID where you input it in the getProductPrices function
//getProductPrices(styleID, callback) takes in a style ID and returns sneaker info including a price map and more images of the product
sneaks.getProductPrices("FY2903", function(err, product){
    console.log(product)
})
//getMostPopular(limit, callback) takes in a limit and returns an array of the current popular products curated by StockX
sneaks.getMostPopular(10, function(err, products){
    console.log(products)
})

Console log of sneaks.getProducts("Yeezy Cinder", ...)
Console log of sneaks.getProductPrices("FY2903", ...)

sneaks-api's People

Contributors

druv5319 avatar hyusap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sneaks-api's Issues

FlightClub and Goat size pricing issue

HI
I have checked sneaks-api its have following issue missing sizing/prices of FlightClub and Goat I think this is because of they both apply google captcha

Error 403 Forbidden error when trying to get information from Goat

Hi,

I tried to run this API on AWS Lambda and Google Firebase both, but when I am running it I get the following error. I end up not being able to retrieve any information from Goat even though I know that the information is there. However, StockX still works:

Error: Could not connect to Goat while grabbing pictures for 'GY3438' Error:
at Object.getPictures (/var/task/node_modules/sneaks-api/scrapers/goat-scraper.js:105:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)

HTTPError: Response code 403 (Forbidden)
at Request. (/var/task/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
code: 'ERR_NON_2XX_3XX_RESPONSE',
timings: {
start: 1648073321821,
socket: 1648073321822,
lookup: 1648073321862,
connect: 1648073321863,
secureConnect: undefined,
upload: 1648073321863,
response: 1648073321922,
end: 1648073321922,
error: undefined,
abort: undefined,
phases: {
wait: 1,
dns: 40,
tcp: 1,
tls: undefined,
request: 0,
firstByte: 59,
download: 0,
total: 101
}
}
}

Error message when running:

DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:93835) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Sneaks app listening on port 3000
(node:93835) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
name: 'MongoNetworkError'
}]

Error: Could not connect to Goat while searching 'SKU'

Error: Could not connect to Goat while searching 'DH6927-140' Error:
at Object.getLink (C:\Users\Matilin\Documents\HurricaneTool\Discord Bot again\node_modules\sneaks-api\scrapers\goat-scraper.js:27:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

i'm getting this error with every single SKU ! Have you an idea ?

Integrating with Express or React application

I tried integrating the API with an existing MERN Stack project I am working on. Initially I wanted to make a direct call to the API from the front end (built in React), and after installing the package, I included the following code in my component:

componentDidMount() {
        const sneaksAPI = require('sneaks-api');
        const sneaks = new sneaksAPI();

        sneaks.getProductPrices("FY2903", function (err, product) {
            console.log(product)
        })
    }

This resulted in the following error:

Failed to compile.
./node_modules/http2-wrapper/source/index.js  
Module not found: Can't resolve 'http2' in '<project-directory>\node_modules\http2-wrapper\source'

I then tried to integrate it with my back end (built with express) where after installation, I included the following code in one of my controller functions:

const sneaksAPI = require('sneaks-api');
        const sneaks = new sneaksAPI();

        sneaks.getProductPrices("FY2903", function (err, product) {
            console.log(product)
        })

Running this code resulted in this an error on the first line:

NEW API
UNCAUGHT EXCEPTION! οΏ½πŸ’₯ Shutting down.
Error listen EADDRINUSE: address already in use :::3080
Error: listen EADDRINUSE: address already in 
use :::3080
    at Server.setupListenHandle [as _listen2] (net.js:1300:14)
    at listenInCluster (net.js:1348:12)      
    at Server.listen (net.js:1436:7)
    at Function.listen (<project-directory>\..\node_modules\express\lib\application.js:618:24)
    at Object.<anonymous> (<project-directory>\..\node_modules\sneaks-api\index.js:18:5)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at exports.getSneakers (<project-directory>\controllers\sneakerController.js:115:21)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

How do I integrate the API in my project?

Air Force 1 has different SKU StockX than on Goat

I am trying to use the API to retrieve sizes for "Nike Air Force 1 Low '07 White" on both Goat and StockX. The SKU on StockX is 315122-111/CW2288-111, but the SKU on Goat is only CW2288-111. Therefore, when I run the getProductPrices method I need to use the StockX SKU and as a result the Goat information does not show up. How can I fix this? Here is my output:

{
lowestResellPrice: { stockX: 96 },
resellPrices: {
stockX: {
'5': 146,
'6': 101,
'7': 105,
'8': 109,
'9': 114,
'10': 113,
'11': 113,
'12': 116,
'13': 116,
'14': 96,
'15': 102,
'16': 135,
'17': 102,
'18': 101,
'3.5': 999999,
'6.5': 108,
'7.5': 112,
'8.5': 113,
'9.5': 113,
'10.5': 112,
'11.5': 116,
'12.5': 118
}
},
imageLinks: [],
_id: 62312d74e1337662c057a166,
shoeName: "Nike Air Force 1 Low '07 White",
brand: 'Nike',
silhoutte: "Nike Air Force 1 Low '07",
styleID: '315122-111/CW2288-111',
make: "Nike Air Force 1 Low '07",
colorway: 'White/White',
retailPrice: 90,
thumbnail: 'https://images.stockx.com/images/Nike-Air-Force-1-Low-White-07_V2-Product.jpg?fit=fill&bg=FFFFFF&w=700&h=500&fm=webp&auto=compress&trim=color&q=90&dpr=2&updated_at=1631122839',
releaseDate: '2007-11-24',
description: 'The Nike Air Force 1 Low White β€˜07 features an all-white leather upper with a perforated toe box and Swoosh overlays. A Nike heel embroidery and white sole completes the design.\n' +
'
\n' +
'
\n' +
'The Nike Air Force 1 Low White β€˜07 originally released in 2007, but since it is an essential colorway to the brand, it consistently restocks.',
urlKey: 'nike-air-force-1-low-white-07',
resellLinks: { stockX: 'https://stockx.com/nike-air-force-1-low-white-07' }
}

API is down

Nothing is working getting a 403. Your site isn’t working either.

stockx scraper error with shoe.styleID

ERROR FOUND IN:
node_modules/sneaks-api/scrapers/stockx-scraper.js:62

let err = new Error("Could not connect to StockX while searching '", shoe.styleID, "' Error: ", error)
^
TypeError: Cannot read properties of undefined (reading 'styleID')
at Object.getProductsAndInfo /node_modules/sneaks-api/scrapers/stockx-scraper.js:62:87)

Any solutions?

Not working for StadiumGoods

Thank your for this great library.
But this is not working for StadiumGoods and seems that that site is updated for security.
How can I get products from that site?
Regard

Is it legal to scrape StockX, Goat, Flight Club and Stadium Goods?

Hello,

I'm just wondering, Is it legal to scrape StockX, Goat, Flight Club and Stadium Goods?
I would love to use your API for a website that I'm building - but not sure if it's legal to use.
Would I get screwed over if I ended up hosting my website?

PS: I love the work you're doing, and the API is amazing.

Thank you

FlightClub Token error

Working on a school project and the flight club token grabbing works fine on localhost

but when hosted on heroku it gives me Error: Could not connect to Flight Club while grabbing token
Any ideas how to fix or quick work around?
I tried adding a or statement for a token I got from https://www.flightclub.com/token

HTTPError: Response code 400 (Bad Request)

Usage
I'm not sure why, but I just installed this npm package, and used the example provided:
sneaks.getProducts("Yeezy Cinder", function(err, products){ console.log(products) });

Problem
However, I keep on getting the same error of:
(node:19940) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'styleID' of undefined at Object.getProductsAndInfo (\node_modules\sneaks-api\scrapers\stockx-scraper.js:66:87) at processTicksAndRejections (internal/process/task_queues.js:97:5) <node_internals>/internal/process/warning.js:32 (node:19940) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) <node_internals>/internal/process/warning.js:32 (node:19940) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Attempt to figure out why
So I went to the directory of the error which is \node_modules\sneaks-api\scrapers\stockx-scraper.js:66:87 and added a new line of code at line 65 to console.log(error) before it throws the error.

The actual problem
So I ran the code to see what was the actual error, then I found this
HTTPError: Response code 400 (Bad Request) at Request.<anonymous> (node_modules\got\dist\source\as-promise\index.js:117:42) at processTicksAndRejections (internal/process/task_queues.js:97:5) {name: 'HTTPError', code: undefined, timings: {…}, stack: 'HTTPError: Response code 400 (Bad Request) …ctions (internal/process/task_queues.js:97:5)', message: 'Response code 400 (Bad Request)', …} code:undefined message:'Response code 400 (Bad Request)' name:'HTTPError' options:{method: 'POST', retry: {…}, headers: {…}, hooks: {…}, cache: undefined, …} request:Request {_readableState: ReadableState, readable: false, _events: {…}, _eventsCount: 16, _maxListeners: undefined, …} response:IncomingMessage {_readableState: ReadableState, readable: false, _events: {…}, _eventsCount: 4, _maxListeners: undefined, …} stack:'HTTPError: Response code 400 (Bad Request)\n at Request.<anonymous> node_modules\\got\\dist\\source\\as-promise\\index.js:117:42)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)' timings:{start: 1618015392952, socket: 1618015392953, lookup: 1618015392954, connect: 1618015393101, secureConnect: 1618015393297, …} __proto__:RequestError

Images
Here is a screenshot of the error

Getting an Undefined Console.log output

When I just run the example code:

const SneaksAPI = require('sneaks-api');
const sneaks = new SneaksAPI();

//getProducts(keyword, limit, callback) takes in a keyword and limit and returns a product array 
sneaks.getProducts("Yeezy Cinder", 1, function(err, products){
    console.log(products)
})

I'm getting the following error:

HTTPError: Response code 530 (undefined)
    at Request.<anonymous> (c:\Users\tallt\node_modules\got\dist\source\as-promise\index.js:117:42)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1647028516117,
    socket: 1647028516170,
    lookup: undefined,
    connect: undefined,
    secureConnect: undefined,
    upload: 1647028516171,
    response: 1647028516220,
    end: 1647028516222,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 53,
      dns: undefined,
      tcp: undefined,
      tls: undefined,
      request: NaN,
      firstByte: 49,
      download: 2,
      total: 105
    }
  }
}
[
  {
    lowestResellPrice: { stockX: 222, flightClub: 205, goat: 231 },
    imageLinks: [],
    _id: 622ba924b422211908155725,
    shoeName: 'adidas Yeezy Boost 350 V2 Mono Cinder',
    brand: 'adidas',
    silhoutte: 'adidas Yeezy Boost 350 V2',
    styleID: 'GX3791',
    make: 'adidas Yeezy Boost 350 V2',
    colorway: 'Mono Cinder/Mono Cinder/Mono Cinder',
    retailPrice: 220,
    thumbnail: 'https://images.stockx.com/images/adidas-Yeezy-Boost-350-V2-Mono-Cinder-Product.jpg?fit=fill&bg=FFFFFF&w=700&h=500&fm=webp&auto=compress&trim=color&q=90&dpr=2&updated_at=1635434704',
    releaseDate: '2021-06-24',
    description: "The Yeezy Boost 350 V2 'Mono Cinder' features a blacked-out look on its updated construction. Releasing as part of the Mono Pack, the shoe's upper is built with monofilament mesh in place of the usual Primeknit, finished entirely in black. The signature side stripe adds a minor deviation, while an internal cage and webbing heel pull-loop support the fit. Underfoot, the tonal tooling includes a Boost midsole wrapped in a rubber cage for cushioning, while the shoe itself dropped exclusively on Yeezy Supply.",
    urlKey: 'adidas-yeezy-boost-350-v2-mono-cinder',
    resellLinks: {
      stockX: 'https://stockx.com/adidas-yeezy-boost-350-v2-mono-cinder',
      flightClub: 'https://www.flightclub.com/yeezy-boost-350-v2-mono-light-yzy-350-v2-mono-light',
      goat: 'http://www.goat.com/sneakers/yeezy-boost-350-v2-mono-light-yzy-350-v2-mono-light'
    },
    goatProductId: 743922
  }
]

I get the right info at the end, but I have to sift through the error message. How do I fix this?

imageLinks

Same issue and I think if I GET request an http://localhost:3000/id/${styleID}/prices in like a 20 request that error will occur.

HTTPError: Response code 403 (Forbidden)
    at Request.<anonymous> (/mnt/d/Project/Hypekicks-web/backend/node_modules/got/dist/source/as-promise/index.js:117:42)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: undefined,
  timings: {
    start: 1605155076168,
    socket: 1605155076231,
    lookup: 1605155076231,
    connect: 1605155076231,
    secureConnect: 1605155076231,
    upload: 1605155076231,
    response: 1605155076340,
    end: 1605155076342,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 63,
      dns: 0,
      tcp: 0,
      tls: 0,
      request: NaN,
      firstByte: 109,
      download: 2,
      total: 174
    }
  }
}
Error: Could not connect to StockX while searching '
    at Object.getPrices (/mnt/d/Project/Hypekicks-web/backend/scrapers/stockx-scraper.js:93:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: Could not connect to Flight Club while searching '555088-105' Error: 
    at Object.getPrices (/mnt/d/Project/Hypekicks-web/backend/scrapers/flightclub-scraper.js:76:31)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: Could not connect to Goat while grabbing pictures for '555088-105' Error: 
    at Object.getPictures (/mnt/d/Project/Hypekicks-web/backend/scrapers/goat-scraper.js:104:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
HTTPError: Response code 403 (Forbidden)
    at Request.<anonymous> (/mnt/d/Project/Hypekicks-web/backend/node_modules/got/dist/source/as-promise/index.js:117:42)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: undefined,
  timings: {
    start: 1605155077174,
    socket: 1605155077499,
    lookup: 1605155077499,
    connect: 1605155077499,
    secureConnect: 1605155077499,
    upload: 1605155077499,
    response: 1605155077966,
    end: 1605155077967,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 325,
      dns: 0,
      tcp: 0,
      tls: 0,
      request: NaN,
      firstByte: 467,
      download: 1,
      total: 793
    }
  }
}
Error: Could not connect to Goat while searching '555088-105' Error:
    at Object.getPrices (/mnt/d/Project/Hypekicks-web/backend/scrapers/goat-scraper.js:64:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Integration problem with React App

I have tried to integerate the api in React app and adding the simple line const SneaksAPI = require("sneaks-api"); gives the error Cannot read property 'prototype' of undefined

How to get rid of this or there are some other steps I need to follow?

Item Descriptions

I did like you said and remove line #29 from StockX scraper file but once I do that I lose the Descriptions from all items. Is there a work around for this?

Discord:
Coins Wild#8215

Installation error

I get this error when I install

root@vmi71:~# npm install sneaks-api
npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.

+ [email protected]
updated 1 package and audited 279 packages in 1.438s

22 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

root@vmi71:~# npm fund
/root
β”œβ”€β”¬ https://github.com/cheeriojs/cheerio?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/sindresorhus/got?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://opencollective.com/mongoose
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/sponsors/fb55
β”‚ └── [email protected], [email protected], [email protected], [email protected],                                                                                        [email protected]
β”œβ”€β”¬ https://github.com/cheeriojs/dom-serializer?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/fb55/domhandler?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/fb55/htmlparser2?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/fb55/domutils?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/fb55/nth-check?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/fb55/entities?sponsor=1
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/sponsors/ljharb
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/sponsors/feross
β”‚ └── [email protected]
β”œβ”€β”¬ https://www.patreon.com/feross
β”‚ └── [email protected]
β”œβ”€β”¬ https://feross.org/support
β”‚ └── [email protected]
β”œβ”€β”¬ https://github.com/sindresorhus/is?sponsor=1
β”‚ └── @sindresorhus/[email protected]
β”œβ”€β”¬ https://github.com/sponsors/sindresorhus
β”‚ └── [email protected], [email protected], [email protected], mimic-re                                                                                       [email protected], [email protected]
└─┬ https://github.com/sponsors/epoberezkin
  └── [email protected]

Is this still working?

I'm trying to use this in Vue3 and this is my app.js:

const SneaksAPI = import.meta.glob('sneaks-api');
window.sneaks = SneaksAPI

Then when I'm trying to use sneaks.getMostPopular, it says "sneaks.getMostPopular is not a function"

Converting to an integrated/embedded database

Having a database within this API makes it so searched sneakers including their links to each of the resell sites are cached. Because of this, when searching for product prices, the API is instantly able to grab prices with the product links already cached from previous searches. Currently, this API is dependant on MongoDB and requires users to install MongoDB and have its process running. I'm looking for a way so users don't have to install and run MongoDB, any contributions are greatly appreciated, thanks!

Error: Could not connect to StockX while searching

server.js:

app.get('/api/product', (req, res) => {
    const { sneakerName } = req.query;
    console.log(req.query)
    // Retrieve product details using "sneaks-api" package
    sneaks.getProducts({sneakerName}, 10, function(err, products){
        console.log(products)
    })
});

react component:

const handleSearch = () => {
        // Fetch the product information from the backend
        axios.get(`http://localhost:8000/api/product?sneakerName=${sneakerName}`)
            .then((response) => {
                // Store the product information in the component's state
                setProduct(response.data);
            })
            .catch((error) => {
                console.log('Error:', error);
            });
    };

console.log in server:

Error: Could not connect to StockX while searching '
    at Object.getProductsAndInfo (/Users/tyler/Desktop/code/codingDojo/PA/sneakerverse/server/node_modules/sneaks-api/scrapers/stockx-scraper.js:62:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
null

Seems it is hanging on StockX and not searching the other website. It woks fine in my backend as per npm website instructions but I want to implement front end functionality

UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server

Hey there,

I have a very simple script that mocks up your Method 1 in the getting started guide.

const SneaksAPI = require('sneaks-api');
const Datastore = require('nedb');
const cron = require('node-cron');

const sneaks = new SneaksAPI();
sneaks.getProducts("Yeezy Cinder", function(err, products){
    console.log(products)
});

In my terminal I then run node priceHistory.js and get the following error:

Sneaks app listening on port 3000 (node:11419) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { name: 'MongoNetworkError' }]

Any idea what's up?

ImageLinks

The imageLinks is always empty? how can I fix that ?

Pricing Data Not Returned When Hosting NODE JS service

Hello,

I have a NODEJS restful api web service that I have built in order to call this nodejs library from my custom application. When serving up the web service locally using LocalHost, the nodeJS service works great and brings back all the resellPrices as expected. However, when I deploy NODEJS restful api online for consumption, I get strange results. For example when deploying to AWS, I get no resellPricing at all. And then when deploying to Render, I get flightClub prices but no prices for stockX. As mentioned when running it via LocalHost, all resellPrices are brought back.

Does anyone have any idea why I might be having issues with the deployed hosted version where the Local Version works fine?

Writing to File

Can anyone help me figure out how to write the results of getProducts() to a JSON file?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.