Skip to main content

Make your website AI-readable by ChatGPT, Perplexity, Claude and other AI platforms

Project description

Hexagon Python SDK

Make your website AI-readable by ChatGPT, Perplexity, Claude, and other AI platforms.

Installation

pip install hexagon-sdk

Quick Start

Flask

from flask import Flask, render_template
from hexagon import Hexagon

app = Flask(__name__)
hexagon = Hexagon(
    merchant_id='your-merchant-id',
    api_key='your-api-key'
)

@app.route('/')
@hexagon.enhance  # Automatically enhances for AI crawlers
def home():
    return render_template('index.html')

# Blog routes (auto-generated by Hexagon)
@app.route('/blog')
def blog_list():
    blogs = hexagon.get_blogs(page=1, limit=20)
    return render_template('blog_list.html', blogs=blogs['blogs'])

@app.route('/blog/<slug>')
def blog_detail(slug):
    blog = hexagon.get_blog(slug)
    if not blog:
        return "Blog not found", 404
    return render_template('blog_detail.html', blog=blog)

if __name__ == '__main__':
    app.run()

Django

Add to your settings.py:

# settings.py
MIDDLEWARE = [
    ...
    'hexagon.DjangoMiddleware',  # Add Hexagon middleware
    ...
]

HEXAGON_MERCHANT_ID = 'your-merchant-id'
HEXAGON_API_KEY = 'your-api-key'

That's it! All your Django views will now be enhanced for AI crawlers.

What You Get

✅ ChatGPT finds your content instantly
✅ Auto-generate 100+ blogs/day
✅ Track AI bot visits
✅ Content stays on your domain

Features

1. AI-Optimized HTML

The SDK automatically enhances your HTML for AI crawlers by:

  • Adding structured data (Schema.org)
  • Converting content to markdown
  • Injecting AI-friendly metadata
  • Optimizing for search engines

2. Blog Management

Hexagon automatically generates SEO-optimized blogs for your products:

# Get all blogs
blogs = hexagon.get_blogs(page=1, limit=20)

# Get single blog
blog = hexagon.get_blog('wireless-headphones-guide')

3. Smart Caching

Enhanced HTML is cached automatically for fast performance. Only the first AI crawler request has a small delay.

Manual Enhancement

If you want more control, you can manually enhance HTML:

from hexagon import Hexagon

hexagon = Hexagon(merchant_id='xxx', api_key='xxx')

# Enhance HTML manually
html = "<html><body>Hello World</body></html>"
enhanced = hexagon.enhance_html(
    html=html,
    url="https://example.com",
    user_agent="GPTBot"
)

Configuration

hexagon = Hexagon(
    merchant_id='your-merchant-id',  # Required
    api_key='your-api-key',          # Required
    api_url='https://joinhexagon.com/api/v1',  # Optional
    debug=False                       # Optional: enable debug logging
)

Requirements

  • Python 3.7+
  • requests

Support

Need help? Email us at hello@joinhexagon.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexagon_sdk-1.0.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hexagon_sdk-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file hexagon_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: hexagon_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for hexagon_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e372bfa7b391a6769699b6d7af476fc4df626e4ca7d3a156edce8c617b6132f3
MD5 8ada83963c337e25f4103356d312f66a
BLAKE2b-256 29fe17584941b3065b835e8abe16ff837ce3410973763634e9c674ddc6d6eeb1

See more details on using hashes here.

File details

Details for the file hexagon_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hexagon_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for hexagon_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94d1f647954579b2add72d103bf5f59acff186fe6b086172848567e6eaa77fe5
MD5 4213fde5e095a5320db529b57d72de8b
BLAKE2b-256 e554844b29e4e1226d71c73a46c3bd6e4fe4fd9f2a2bff31020593705a207111

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page