# Auth.md

> Authentication and API access documentation for B2Bs.com AI agents.

## Public Access (No Authentication Required)

Most B2Bs.com content is publicly accessible without authentication:

- **Homepage**: `GET https://b2bs.com/`
- **Category browsing**: `GET https://b2bs.com/list/{category}/`
- **Site details**: `GET https://b2bs.com/site/{id}/`
- **Article reading**: `GET https://b2bs.com/Insights/`
- **Search**: `GET https://b2bs.com/search.php?q={query}`
- **Markdown content**: Send `Accept: text/markdown` header to any page
- **llms.txt**: `GET https://b2bs.com/llms.txt`
- **Sitemap**: `GET https://b2bs.com/sitemap.xml`
- **API Catalog**: `GET https://b2bs.com/.well-known/api-catalog`
- **MCP Server Card**: `GET https://b2bs.com/.well-known/mcp.json`
- **Agent Skills**: `GET https://b2bs.com/.well-known/agent-skills/index.json`

## Content Signals

B2Bs.com uses Content Signals in robots.txt to communicate AI usage permissions:

| Signal | Value | Meaning |
|--------|-------|---------|
| `search` | `yes` | Building search indexes and providing search results is allowed |
| `ai-input` | `yes` | Inputting content into AI models (RAG, grounding) is allowed |
| `ai-train` | `no` | Training or fine-tuning AI models is NOT allowed |

## Markdown Content Negotiation

AI agents can request any page in Markdown format by sending the appropriate Accept header:

```
GET / HTTP/1.1
Host: b2bs.com
Accept: text/markdown
```

The server will respond with `Content-Type: text/markdown; charset=utf-8` and a Markdown representation of the page content.

## Rate Limiting

- Public endpoints are rate-limited via Cloudflare
- Recommended: maximum 1 request per second for automated access
- For higher rate limits, contact: b2bs.com@gmail.com

## Optional Authentication (User Accounts)

Some features require a user account:

- **Site submission with dashboard**: Register at `https://b2bs.com/manage/register.php`
- **Featured listings**: Login at `https://b2bs.com/manage/login.php`
- **User dashboard**: `https://b2bs.com/manage/home.php`

### Registration

```
POST https://b2bs.com/manage/register.php
Content-Type: application/x-www-form-urlencoded

username={username}&password={password}&email={email}
```

### Login

```
POST https://b2bs.com/manage/login.php
Content-Type: application/x-www-form-urlencoded

user={username}&password={password}
```

After login, a PHP session cookie (`PHPSESSID`) is set for subsequent authenticated requests.

## Agent Registration

AI agents can register for enhanced access to B2Bs.com directory APIs:

### Agent Registration Endpoint

```
POST https://b2bs.com/manage/register.php
Content-Type: application/x-www-form-urlencoded

username={agent_name}&password={password}&email={contact_email}
```

After registration, agents receive a `PHPSESSID` session cookie for authenticated requests. Registered agents get access to:
- Site submission with dashboard tracking
- Featured listing management
- Submission status monitoring

### Agent Authentication Flow

1. **Register**: Create an account at `https://b2bs.com/manage/register.php`
2. **Login**: Authenticate via `POST https://b2bs.com/manage/login.php`
3. **Session**: Use the returned `PHPSESSID` cookie for subsequent requests
4. **Access**: Authenticated endpoints at `https://b2bs.com/manage/home.php`

### Public Agent Access (No Registration Required)

Unregistered agents can access all public directory content:
- Browse categories, sites, and articles
- Search the directory
- Submit new sites via `https://b2bs.com/aiurl/`
- Retrieve Markdown content via `Accept: text/markdown`
- Access all `.well-known` discovery endpoints

## OAuth / API Keys

B2Bs.com does not currently require OAuth or API keys for public content access. For programmatic API access with higher rate limits, contact b2bs.com@gmail.com to register your agent.

## Contact

- **General inquiries**: b2bs.com@gmail.com
- **Site submissions**: https://b2bs.com/aiurl/
- **About page**: https://b2bs.com/about/

## Robots.txt

Full crawler access rules are available at: https://b2bs.com/robots.txt

AI bots (GPTBot, ClaudeBot, Google-Extended, CCBot, etc.) are explicitly allowed for search and AI input purposes. Training is not permitted per Content Signals.
