Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to get local advertisements from localbitcoins.com the API endpoint is /buy-bitcoins-with-cash/{location_id}/{location_slug}/.json

Using the python library I go with this code:

from lbcapi3 import api
hmac_key = 'my public key'
hmac_secret = 'my secret key'
conn = api.hmac(hmac_key, hmac_secret)
cash_trades=conn.call('GET', '/buy-bitcoins-with-cash/4.7109886/-74.072092/').js

And I get this error:

  File "<ipython-input-28-8ee0ec40da0f>", line 1, in <module>
    cash_trades=conn.call('GET', '/buy-bitcoins-with-cash/4.7109886/-74.072092/').json()

  File "C:UsersChuoxAnaconda3libsite-packages
equestsmodels.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)

  File "C:UsersChuoxAnaconda3libjson\__init__.py", line 348, in loads
    return _default_decoder.decode(s)

  File "C:UsersChuoxAnaconda3libjsondecoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "C:UsersChuoxAnaconda3libjsondecoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value

Not sure if I'm using the wrong parameters for the endpoint, I'm trying to find a successful example with no luck.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
387 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think the location id and slug are more like codes, for example you can do something like this:

"https://localbitcoins.com/buy-bitcoins-online/gbp/c/bank-transfers/.json"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...