Using Python to get meta for a URL, take screenshot, and get DNS records
Using requests
package in Python:
import requests
authKey = "YOUR_AUTH_KEY" # your AUTH_KEY from https://urlmeta.org
# to get the DNS records, change the URL to https://api.urlmeta.org/dns
# for screenshot, change the URL to https://api.urlmeta.org/screenshot
url = "https://api.urlmeta.org/meta"
querystring = {"url": "https://backupdiary.com"} # for DNS, change the querystring to {"domain": "backupdiary.com"}
headers = {
'accept': "application/json",
'content-type': "application/json",
'Authorization': "Basic " + authKey
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
Render HTML or SVG as an image using Python
Using requests
package in Python:
import requests
authKey = "YOUR_AUTH_KEY" # your AUTH_KEY from https://urlmeta.org
url = "https://api.urlmeta.org/render"
querystring = {"format": "svg"} # either svg or html
body = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"><rect width=\"300\" height=\"100\" style=\"fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)\" /></svg>" # just a blue rectangle
# or HTML like this
# body = "<p style='font-size: 30px;'>My first paragraph.</p>"
headers = {
'accept': "application/json",
'content-type': "application/xml",
'Authorization': "Basic " + authKey
}
response = requests.request("POST", url, headers=headers, params=querystring, data=body)
print(response.text)