Module scrapfly.classify

Classify API response model.

Mirrors the /classify endpoint response. See https://scrapfly.io/docs/scrape-api/classify for the full contract.

Classes

class ClassifyResult (blocked: bool, antibot: Optional[str], cost: int)
Expand source code
@dataclass
class ClassifyResult:
    blocked: bool
    antibot: Optional[str]
    cost: int

    @classmethod
    def from_dict(cls, data: dict) -> "ClassifyResult":
        return cls(
            blocked=bool(data.get("blocked", False)),
            antibot=data.get("antibot"),
            cost=int(data.get("cost", 0)),
        )

ClassifyResult(blocked: 'bool', antibot: 'Optional[str]', cost: 'int')

Static methods

def from_dict(data: dict) ‑> ClassifyResult

Instance variables

var antibot : str | None
var blocked : bool
var cost : int