Python-Powered Precision: Categorize the Web with Ease.

WebPage category data API use case.


Very often as SEO professionals we need to check Websites' categorization data for certain domain and there is a very useful online service for web developers and SEO professionals on "WhoisXML API" that provides Domain & IP Data Intelligence for Greater Enterprise Security and RESTful APIs that we will use.

Using it's APIs you can perform many handy data requests, for example you can Websites' category data for a certain website - don't forget to get your API KEY. You will obtain ready to use parsed contact categorization using machine learning (ML) engine which scans a website’s content and meta tags and extracts text to classify the site and assign the top Internet Advertising Bureau (IAB) categories applicable to it with associated confidence scores with help of natural language processing (NLP).

Website category via API.
Website category via API meme.

Python Knowledge Base: Make coding great again.
- Updated: 2024-07-23 by Andrey BRATUS, Senior Data Analyst.




    This Python script below will use information from "WhoisXML API" and provide you a result in a JSON format without the need to use a web browser.
    Getting websites' category data can be easily automated now !



  1. Python code to get Website categorization data via API:


  2. 
    # Website Categorization API USE
    
    import requests
    
    
    website = 'python-code.pro'
    
    APIKEY ='at_ZUVkrukr4Uhhhsfq2j6dyv2VhFGWYV'
       
    categorizationInfoURL = f'https://website-categorization.whoisxmlapi.com/api/v2?apiKey={APIKEY}&domainName={website}'
    
    r = requests.get(categorizationInfoURL)
    
    categorizationInfo = r.json()
    
    print(f'Categorization Info for {website} domain.\n')
    categorizationInfo
    

  3. Website categorization data output:


  4. 
    Categorization Info for python-code.pro domain.
    
    {'categories': [{'tier1': {'confidence': 0.9762207679006201,
        'id': 'IAB-596',
        'name': 'Technology & Computing'},
       'tier2': {'confidence': 0.6230869365434839,
        'id': 'IAB-619',
        'name': 'Internet'}},
      {'tier1': {'confidence': 0.9762207679006201,
        'id': 'IAB-52',
        'name': 'Business and Finance'},
       'tier2': {'confidence': 0.6230869365434839,
        'id': 'IAB-99',
        'name': 'Information Services Industry'}},
      {'tier1': {'confidence': 0.9762207679006201,
        'id': 'IAB-52',
        'name': 'Business and Finance'},
       'tier2': {'confidence': 0.6230869365434839,
        'id': 'IAB-115',
        'name': 'Technology Industry'}},
      {'tier1': {'confidence': 0.9762207679006201,
        'id': 'IAB-52',
        'name': 'Business and Finance'},
       'tier2': {'confidence': 0.6230869365434839,
        'id': 'IAB-116',
        'name': 'Telecommunications Industry'}}],
     'domainName': 'python-code.pro',
     'websiteResponded': True}
    




See also related topics: