Skip to content

TeichAI/extractify

Repository files navigation

Extractify

CI npm downloads stars license

AI-powered website data extraction with schema-validated output.

Install

npm install @teichai/extractify

Basic usage

import { ExtractifyClient } from "@teichai/extractify";

const client = new ExtractifyClient({
  model: "openai/gpt-oss-20b",
});

const result = await client.extractFromUrl({
  url: "https://example.com",
  schema: {
    type: "object",
    properties: {
      title: { type: "string" },
      price: { type: "number" },
    },
    required: ["title", "price"],
    additionalProperties: false,
  },
  instructions: "Extract the product title and numeric price.",
});

console.log(JSON.stringify(result, null, 2));

Notes

  • apiKey defaults to process.env.API_KEY
  • Validation is on by default; set validate: false to disable

Configuration

  • baseUrl: OpenAI-compatible base URL (defaults to https://openrouter.ai/api/v1)
  • model: Model name (required)
  • flaresolverrUrl: Use FlareSolverr for all page fetches

Validation

Responses are validated against your JSON Schema by default. If the response does not match, extractFromUrl throws an error. Use validate: false to skip validation for a specific call.

Examples

npm run build
node examples/basic.mjs

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for your change
  4. Run npm test
  5. Open a pull request

License

Non-commercial use only. See LICENSE.

About

AI-powered website data extraction.

Resources

License

Stars

Watchers

Forks