## JSON `client.Extract.Json(ctx, body) (*ExtractJsonResponse, error)` **post** `/extract/json` Fetches a URL and extracts structured data according to a provided JSON schema ### Parameters - `body ExtractJsonParams` - `JsonSchema param.Field[any]` JSON schema definition that describes the structure of data to extract. - `URL param.Field[string]` URL to fetch and extract data from - `Effort param.Field[ExtractJsonParamsEffort]` Fetch effort level controlling speed vs. capability tradeoff. "min": fastest, no fallback (1-5s). "standard": balanced with enhanced reliability (default, 3-15s). "max": full browser rendering for JS-heavy sites (15-60s). - `const ExtractJsonParamsEffortMin ExtractJsonParamsEffort = "min"` - `const ExtractJsonParamsEffortStandard ExtractJsonParamsEffort = "standard"` - `const ExtractJsonParamsEffortMax ExtractJsonParamsEffort = "max"` - `GeoTarget param.Field[ExtractJsonParamsGeoTarget]` Optional geotargeting parameters for proxy requests - `Country string` Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB", "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - `Nocache param.Field[bool]` Bypass cache and force fresh data retrieval ### Returns - `type ExtractJsonResponse map[string, any]` ### Example ```go package main import ( "context" "fmt" "github.com/stainless-sdks/tabstack-go" "github.com/stainless-sdks/tabstack-go/option" ) func main() { client := tabstack.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.Extract.Json(context.TODO(), tabstack.ExtractJsonParams{ JsonSchema: map[string]any{ "properties": map[string]any{ "stories": map[string]any{ "items": map[string]any{ "properties": map[string]any{ "author": map[string]any{ "description": "Author username", "type": "string", }, "points": map[string]any{ "description": "Story points", "type": "number", }, "title": map[string]any{ "description": "Story title", "type": "string", }, }, "type": "object", }, "type": "array", }, }, "type": "object", }, URL: "https://news.ycombinator.com", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "foo": "bar" } ```