Docs/API reference

JobField · Node.js

One extraction rule and its validation requirements. Exported values remain strings.

Download .md
Developers3 min read13 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Purpose and lifecycle

One extraction rule and its validation requirements. Exported values remain strings.

Definition and availability

Source snapshot: 1.0.0-alpha.3. Package export. Declared in source; this is not a runtime test result.

Signatures and source locations are generated from the SDK wrappers. Clean snapshots link to the recorded commit. Modified snapshots link to main, which may differ; file hashes identify the local inputs.

export interface JobField {
  name: string;
  selector: string;
  selector_type?: 'css' | 'xpath' | 'regex' | 'text' | 'after_text' | 'before_text';
  extract_type?: 'text' | 'price' | 'datetime' | 'url' | `attr:${string}`;
  required?: boolean;
  default?: string;
  data_type?: 'string' | 'integer' | 'float' | 'boolean';
  normalize_whitespace?: boolean;
  min_length?: number;
}
typescript11 lines · copy-ready

Members

MemberKindReturn / value typeSource status
namepropertystringPresent in source
selectorpropertystringPresent in source
selector_typeproperty"css" | "xpath" | "regex" | "text" | "after_text" | "before_text" | undefinedPresent in source
extract_typeproperty"text" | "price" | "datetime" | "url" | `attr:${string}` | undefinedPresent in source
requiredpropertyboolean | undefinedPresent in source
defaultpropertystring | undefinedPresent in source
data_typeproperty"string" | "boolean" | "integer" | "float" | undefinedPresent in source
normalize_whitespacepropertyboolean | undefinedPresent in source
min_lengthpropertynumber | undefinedPresent in source

name

Unique field name or context-specific item name.

Returns / value: string.

name: string;
typescript1 lines · copy-ready

selector

Field selector. With row_selector, matches are assigned to the row container.

Returns / value: string.

selector: string;
typescript1 lines · copy-ready

selector_type

css (default), xpath, regex, text, after_text or before_text.

Returns / value: "css" | "xpath" | "regex" | "text" | "after_text" | "before_text" | undefined.

selector_type?: 'css' | 'xpath' | 'regex' | 'text' | 'after_text' | 'before_text';
typescript1 lines · copy-ready

extract_type

text (default), price, datetime, url or attr:name.

Returns / value: "text" | "price" | "datetime" | "url" | `attr:${string}` | undefined.

extract_type?: 'text' | 'price' | 'datetime' | 'url' | `attr:${string}`;
typescript1 lines · copy-ready

required

Reject empty/whitespace-only required fields; default false for job fields.

Returns / value: boolean | undefined.

required?: boolean;
typescript1 lines · copy-ready

default

Fallback when extraction is empty.

Returns / value: string | undefined.

default?: string;
typescript1 lines · copy-ready

data_type

string (default), integer, float or boolean validation; output remains string-valued.

Returns / value: "string" | "boolean" | "integer" | "float" | undefined.

data_type?: 'string' | 'integer' | 'float' | 'boolean';
typescript1 lines · copy-ready

normalize_whitespace

Collapse whitespace runs; default true.

Returns / value: boolean | undefined.

normalize_whitespace?: boolean;
typescript1 lines · copy-ready

min_length

Minimum character count after normalization; default 0.

Returns / value: number | undefined.

min_length?: number;
typescript1 lines · copy-ready

Errors and operational limits

See the consuming API for validation and failure behavior. Types and enum declarations do not perform network requests by themselves.

Source availability, package publication and runtime validation are separate facts. These pages describe the source snapshot, not a claim that all platforms or every API path have passed production acceptance.