How to scrape real-time data from a website that requires login?

Viewed 231

Hey, I'm trying to scrape the price of an item from an online marketplace called Buff.163, they have an API but still require you to login before returning any data.

Error received:

"{ code: "Login Required" error: "\u8bf7\u5148\u767b\u5f55" extra: null }"

Formula used:

=ARRAYFORMULA(JOIN(CHAR(10),SPLIT(IMPORTDATA(CONCAT("https://buff.163.com/api/market/goods/sell_order?game=csgo&goods_id=",REGEXEXTRACT(B3,"goods_id=(\d+)")&"&max_paintwear="&REGEXEXTRACT(B7,"max_paintwear=(....)")))&CHAR(10),CHAR(10))))

I used "&" after the first 2 CONCAT arguments to add the "max_paintwear" value since 2 is the max amount of arguments CONCAT allows, not sure if that's causing any issues.

Example URL used to get the "goods_id" and "paintwear" value:
https://buff.163.com/market/goods?goods_id=43106#max_paintwear=0.03

Final URL it should be scraping the data from:
https://buff.163.com/api/market/goods/sell_order?game=csgo&goods_id=43106&max_paintwear=0.03

Here's a link to the google sheet I was using to test solutions:
https://docs.google.com/spreadsheets/d/1ZVt8_0hjiFwl23snjdrzNm0XCWQ9PRct4ECIG-Ke3Rc/

Any help is greatly appreciated ❤️

0 Answers
Related