Login

How ashra Works

How ashra Works

How ashra Works

ashra is designed to be super simple and versatile. In many cases, we just want to ask a question to a website and get information in a specific structured output. ashra is exactly that - run a prompt without having to do system prompting or anything complicated.

If the request contains: "deep = true", ashra will extract all links in the website and find the best ones to extract the data from. Then it will go through each one of them and then compile the results back .

It's Really This Simple

Want to extract data from a website? Just call our API with:

  1. A URL
  2. Your prompt (what you want to extract)
  3. The schema for your response (how you want the data structured)

That's it. No complex setup, no maintenance headaches, no brittle scrapers.

API Usage Example

Here's a basic example of how to use the ashra API:

Real World Example: HackerNews Top Posts

Let's say you want to extract the top 10 posts with the most comments from Hacker News and order them by date:

// POST http://api.ashra.ai/prompt
// content-type: application/json
 
{
    "url": "https://news.ycombinator.com",
    "prompt": "Extract the top 10 posts with the most comments and order them by date (newest first)",
    "schema": {
    "type": "object",
    "properties": {
      "posts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "The title of the post."
            },
            "url": {
              "type": "string",
              "description": "The URL of the post."
            },
            "points": {
              "type": "number",
              "description": "The score or points associated with the post."
            },
            "commentCount": {
              "type": "number",
              "description": "The number of comments on the post."
            },
            "postedDate": {
              "type": "string",
              "description": "The date and time when the post was created."
            },
            "author": {
              "type": "string",
              "description": "The author of the post."
            }
          },
          "required": [
            "title",
            "url",
            "points",
            "commentCount",
            "postedDate",
            "author"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "posts"
    ],
    "additionalProperties": false
  },
    "options": {
        "deep": true,
        "maxPages": 3
    }
}

And you'd get back a structured response like:

{
  "posts": [
    {
      "title": "Announcing Rust 1.75.0",
      "url": "https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html",
      "points": 783,
      "commentCount": 293,
      "postedDate": "2024-12-28T14:02:23Z",
      "author": "steveklabnik"
    },
    {
      "title": "The Architecture of Open Source Applications",
      "url": "https://aosabook.org/en/index.html",
      "points": 542,
      "commentCount": 245,
      "postedDate": "2024-12-27T19:34:11Z",
      "author": "tosh"
    }
    // ... 8 more posts
  ]
}

Why This Approach Works

ashra takes a fundamentally different approach to web data extraction:

  • No System Prompting Needed: Just ask for what you want directly
  • Handles Site Changes: Works even when websites update their design
  • Structured Output: Get data in exactly the format you need
  • Versatile: Works on virtually any website, not just specific platforms

Get started with ashra today and see how simple web data extraction can be!

Ready to build your next AI agent?