user124971: I want to check multiple bitcoin addresses balance in python, can someone suggest a script that can do it fast and without getting api error.

user136912: you can request this API (it's free to use): https://rapidapi.com/juliakafarska/api/bitcoin-api
import requests

url = "https://bitcoin-api.p.rapidapi.com/balancesByAddress"

payload = {"addresses": ["16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe", "34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo"]}
headers = {
    "content-type": "application/json",
    "X-RapidAPI-Key": "YOUR_KEY_HERE",
    "X-RapidAPI-Host": "bitcoin-api.p.rapidapi.com"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

response:
{
  "note": "Balances for 2 wallet addresses",
  "count": 2,
  "data": [
    {
      "id": 14122055,
      "address": "16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe",
      "btc": 0.00525093
    },
    {
      "id": 25721113,
      "address": "34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo",
      "btc": 0.00111145
    }
  ]
}


user133490: You could do that by fetching an API from a Block Explorer

Mempool.space
BlockStream.info
Blockchair.com

Or by adding a wallet on your Bitcoin node and fetching listunspent

without getting api error

Which API are you using?

124971: <p>I want to check multiple bitcoin addresses balance in python, can someone suggest a script that can do it fast and without getting api error.</p>
 136912: <p>you can request this API (it's free to use): <a href="https://rapidapi.com/juliakafarska/api/bitcoin-api" rel="nofollow noreferrer">https://rapidapi.com/juliakafarska/api/bitcoin-api</a></p>
<pre><code>import requests

url = &quot;https://bitcoin-api.p.rapidapi.com/balancesByAddress&quot;

payload = {&quot;addresses&quot;: [&quot;16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe&quot;, &quot;34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo&quot;]}
headers = {
    &quot;content-type&quot;: &quot;application/json&quot;,
    &quot;X-RapidAPI-Key&quot;: &quot;YOUR_KEY_HERE&quot;,
    &quot;X-RapidAPI-Host&quot;: &quot;bitcoin-api.p.rapidapi.com&quot;
}

response = requests.request(&quot;POST&quot;, url, json=payload, headers=headers)

print(response.text)
</code></pre>
<p>response:</p>
<pre><code>{
  &quot;note&quot;: &quot;Balances for 2 wallet addresses&quot;,
  &quot;count&quot;: 2,
  &quot;data&quot;: [
    {
      &quot;id&quot;: 14122055,
      &quot;address&quot;: &quot;16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe&quot;,
      &quot;btc&quot;: 0.00525093
    },
    {
      &quot;id&quot;: 25721113,
      &quot;address&quot;: &quot;34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo&quot;,
      &quot;btc&quot;: 0.00111145
    }
  ]
}
</code></pre>
 133490: <p>You could do that by fetching an API from a Block Explorer</p>
<ul>
<li><a href="https://mempool.space/docs/api/rest#get-address-utxo" rel="nofollow noreferrer">Mempool.space</a></li>
<li><a href="https://github.com/Blockstream/esplora/blob/master/API.md#get-addressaddresstxs" rel="nofollow noreferrer">BlockStream.info</a></li>
<li><a href="https://blockchair.com/api/docs#link_203" rel="nofollow noreferrer">Blockchair.com</a></li>
</ul>
<p>Or by adding a wallet on your Bitcoin node and fetching <a href="https://developer.bitcoin.org/reference/rpc/listunspent.html" rel="nofollow noreferrer">listunspent</a></p>
<blockquote>
<p>without getting api error</p>
</blockquote>
<p>Which API are you using?</p>
