Skip to content

Instantly share code, notes, and snippets.

@terremoth
Created January 23, 2026 23:07
Show Gist options
  • Select an option

  • Save terremoth/bc3d423e79e987d122d4605936882dcf to your computer and use it in GitHub Desktop.

Select an option

Save terremoth/bc3d423e79e987d122d4605936882dcf to your computer and use it in GitHub Desktop.
Filter API's with no CORS neither Authentication from https://github.com/public-apis/public-apis
from bs4 import BeautifulSoup
with open("input.html", "r", encoding="utf-8") as f:
soup = BeautifulSoup(f, "html.parser")
for table in soup.find_all("table"):
tbody = table.find("tbody")
if not tbody:
continue
for row in tbody.find_all("tr"):
cols = [td.get_text(strip=True).lower() for td in row.find_all("td")]
if len(cols) < 5:
row.decompose()
continue
auth = cols[2]
cors = cols[4]
if not (auth == "no" and cors == "no"):
row.decompose()
with open("output.html", "w", encoding="utf-8") as f:
f.write(str(soup))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment