user135920: i'm new to bitcoin and was wondering, does anyone know how to get unconfirmed transactions with python? I've tried running my own node but my current hardware won't allow it. Is there a way to query the main-net to perhaps get the latest unconfirmed transactions, maybe with a library?
kind of like how it's done on blockchain.info
Thanks

user133407: 
i'm new to bitcoin and was wondering, does anyone know how to get unconfirmed transactions with python?

If you had a bitcoin node:
import requests
import json

url = "http://127.0.0.1:PORT"

payload = json.dumps({
  "jsonrpc": "1.0",
  "id": "test",
  "method": "getrawmempool",
  "params": [
    True
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic dXNlcjpwYXNz'
}

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

print(response.json())


Else you could use API for any 2 block explorers:
import requests

url = "https://mempool.space/api/mempool/txids"

headers = {
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.json())

URL can be https://blockstream.info/api/mempool/txids for blockstream.info explorer.

135920: <p>i'm new to bitcoin and was wondering, does anyone know how to get unconfirmed transactions with python? I've tried running my own node but my current hardware won't allow it. Is there a way to query the main-net to perhaps get the latest unconfirmed transactions, maybe with a library?</p>
<p>kind of like how it's done on blockchain.info
Thanks</p>
 133407: <blockquote>
<p>i'm new to bitcoin and was wondering, does anyone know how to get unconfirmed transactions with python?</p>
</blockquote>
<p>If you had a bitcoin node:</p>
<pre><code>import requests
import json

url = &quot;http://127.0.0.1:PORT&quot;

payload = json.dumps({
  &quot;jsonrpc&quot;: &quot;1.0&quot;,
  &quot;id&quot;: &quot;test&quot;,
  &quot;method&quot;: &quot;getrawmempool&quot;,
  &quot;params&quot;: [
    True
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic dXNlcjpwYXNz'
}

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

print(response.json())

</code></pre>
<p>Else you could use API for any 2 block explorers:</p>
<pre><code>import requests

url = &quot;https://mempool.space/api/mempool/txids&quot;

headers = {
  'Content-Type': 'application/json'
}

response = requests.request(&quot;GET&quot;, url, headers=headers)

print(response.json())
</code></pre>
<p>URL can be <a href="https://blockstream.info/api/mempool/txids" rel="nofollow noreferrer">https://blockstream.info/api/mempool/txids</a> for blockstream.info explorer.</p>
