# jesperdote/polymarket_scraper architecture

> Architecture diagram of the GitHub repository jesperdote/polymarket_scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jesperdote/polymarket_scraper
- Repository: https://github.com/jesperdote/polymarket_scraper

## Overview

This small command-line scraper reads market slugs and optional webhook URLs, fetches open-market data, and reports prices. Its alert rule flags markets where the “No” outcome exceeds 0.80, then sends formatted alerts to configured Slack and/or Discord webhooks. The supplied files show the entry point and request helpers; the referenced input files are not present in the tree, so they are shown as external inputs.

Main entry points: [`main.py`](https://github.com/jesperdote/polymarket_scraper/blob/main/main.py) (Scrape and alert), [`utils/notifications.py`](https://github.com/jesperdote/polymarket_scraper/blob/main/utils/notifications.py) (Webhook senders), [`utils/api.py`](https://github.com/jesperdote/polymarket_scraper/blob/main/utils/api.py) (Market API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Scraper workflow"]
  node_main["Scrape and alert<br/>[main.py]"]
  node_api["Market API client<br/>[api.py]"]
  node_notifications["Webhook senders<br/>[notifications.py]"]
end

subgraph group_integrations["External services"]
  node_polymarket["Polymarket API"]
  node_slack["Slack webhook"]
  node_discord["Discord webhook"]
end

node_operator(("Local inputs"))

node_operator -->|"provides inputs"| node_main
node_main -->|"fetches markets"| node_api
node_api -->|"requests data"| node_polymarket
node_polymarket -->|"returns data"| node_api
node_main -->|"sends alerts"| node_notifications
node_notifications -.->|"posts alert"| node_slack
node_notifications -.->|"posts alert"| node_discord

click node_main "https://github.com/jesperdote/polymarket_scraper/blob/main/main.py"
click node_api "https://github.com/jesperdote/polymarket_scraper/blob/main/utils/api.py"
click node_notifications "https://github.com/jesperdote/polymarket_scraper/blob/main/utils/notifications.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_api,node_notifications toneBlue
class node_polymarket,node_slack,node_discord toneAmber
class node_operator toneIndigo
```

## Components

### Scraper workflow

- [Scrape and alert](https://github.com/jesperdote/polymarket_scraper/blob/main/main.py): `main.py`
- [Market API client](https://github.com/jesperdote/polymarket_scraper/blob/main/utils/api.py): `utils/api.py`
- [Webhook senders](https://github.com/jesperdote/polymarket_scraper/blob/main/utils/notifications.py): `utils/notifications.py`

### External services

- **Polymarket API**
- **Slack webhook**
- **Discord webhook**

### Other components

- **Local inputs**

## Connections

- Local inputs → Scrape and alert: provides inputs
- Scrape and alert → Market API client: fetches markets
- Market API client → Polymarket API: requests data
- Polymarket API → Market API client: returns data
- Scrape and alert → Webhook senders: sends alerts
- Webhook senders → Slack webhook: posts alert
- Webhook senders → Discord webhook: posts alert
