How to Get Reputation Scoring of IPs Using Python?
With the Ponarize API, adding IP query capabilities to existing applications or services is effortless. It facilitates the retrieval of comprehensive data on the IP addresses being queried. This includes, but is not limited to, categorization information, ports attacked, and reputation scores.
<br>
<h3>Let's see how it functions</h3>
<br>
<b>1-</b> Visit https://www.ponarize.com first.
<br><br>
<b>2-</b> Finish the SIGN UP procedure by clicking the "GET API KEY" button.
<br><br>
<b>3-</b> Get an API key with your free 100 credits.
<br><br>
<b>4-</b> The integration can now begin. Scroll down to the "API Keys" section in the Dashboard.
<br><br>
<b>5-</b> Click the Generate button and get your API key.
<br><br>
<b>6-</b> After selecting the endpoint, you can review the Sample Code Snippets to integrate the API with PHP, Python, JavaScript, jQuery, AJAX, etc. In this article we will focus on Python.
<br><br>
<h3>API response in Python:</h3>
<br>
<pre class="fs-7 text-gray-800 fw-semibold" style="background: rgb(34, 34, 34); position: relative;">
<span style="color: #00c4c4;">
import requests
url = "https://www.ponarize.com/api/check/ip"
payload = "{\"ip\":\"35.236.146.166\"}\n"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "<span style="color: orangered">YOUR-API-KEY</span>"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
</span>
</pre>
<br><br>
Let's look at an example will receive from the API:
<br><br>
<pre style="background: rgb(34, 34, 34); position: relative;">
<span style="color: #b060b0;">{</span><span style="color: #d1d1d1;">
</span><span style="color: #00c4c4;">"status"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"success"</span><span style="color: #d2cd86;">,</span><span style="color: #d1d1d1;"><span style="color: #d1d1d1;">
</span><span style="color: #00c4c4;">"message"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #d2cd86;">[</span><span style="color: #d1d1d1;">
</span><span style="color: #b060b0;">{</span><span style="color: #d1d1d1;">
</span><span style="color: #00c4c4;">"ip"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"35.236.146.166"</span><span style="color: #d2cd86;">,</span><span style="color: #d1d1d1;">
</span><span style="color: #00c4c4;">"range"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"35.208.0.0\/12"</span><span style="color: #d2cd86;">,</span><span style="color: #d1d1d1;">
</span><span style="color: #00c4c4;">"country"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"United States"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"countryCode"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"US"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"city"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"Mountain View"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"timezone"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"America\/Los_Angeles"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"reverse"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"-"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"lat"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"37.42240"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"lon"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"-122.08421"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"isp"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"Google LLC"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"org"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"Google LLC"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"asn"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"396982"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"asnName"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"Google LLC"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"netName"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"-"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"descr"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"GOOGLE-CLOUD"</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"openPorts"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #d2cd86;">[</span><span style="color: #00c4c4;">"-"</span><span style="color: #d2cd86;">]</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"risk"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #00c4c4;">"100"</span><span style="color: #d1d1d1;"><span style="color: #d2cd86;">,</span>
</span><span style="color: #00c4c4;">"attacks"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #b060b0;">{</span>
<span style="color: #00c4c4;">"ports"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #b060b0;">{</span><span style="color: #00c4c4;">"21":"376"</span><span style="color: #b060b0;">}</span><span style="color: #d1d1d1;"></span><span style="color: #d2cd86;">,</span>
<span style="color: #00c4c4;">"hours"</span><span style="color: #d2cd86;">:</span><span style="color: #d1d1d1;"> </span><span style="color: #b060b0;">{</span><span style="color: #00c4c4;">"00:00":"25","01:00":"14"</span><span style="color: #b060b0;">}</span><span style="color: #d1d1d1;"></span>
</span><span style="color: #b060b0;">}</span><span style="color: #d1d1d1;">
</span><span style="color: #b060b0;">}</span><span style="color: #d1d1d1;">
</span><span style="color: #d2cd86;">]</span><span style="color: #d1d1d1;">
</span><span style="color: #b060b0;">}</span><span style="color: #d1d1d1;">
</span><div class="open_grepper_editor" title="Edit & Save To Grepper"></div>
</pre>
<br>
For any questions, you can contact support through the chat feature at https://www.ponarize, or send an email to [email protected] with your inquiry!
<br>
2024-02-26