# Autoparse

Source: https://docs.scrappey.com/docs/autoparse

> Automatically parse structured data from a web page using AI, with no need for exact selectors or knowledge of the HTML structure.

## Command

Enable autoparsing by setting `"autoparse": true` and providing a `structure` field that defines the JSON format you want the response to follow.

## Parameters

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ----------- |
| `autoparse` | boolean | Yes | Set to `true` to enable AI-based autoparsing of the response. |
| `structure` | object | Yes | JSON object describing the data shape you want the AI to extract. |

## Example

```json
"structure": {
  "movie_info": {
    "title": "str",
    "language": "str"
  },
  "duration": "str",
  "release_date": "str",
  "rating": {
    "average_rating": "float",
    "total_votes": "int"
  },
  "certification": "str",
  "cast": [
    {
      "actor_name": "str",
      "role": "str"
    }
  ],
  "crew": [
    {
      "crew_name": "str",
      "role": "str"
    }
  ]
}
```

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.get",
    "url": "https://movies.com/",
    "autoparse": true,
    "structure": {
      "movie_info": {
        "title": "str",
        "language": "str"
      },
      "duration": "str",
      "release_date": "str",
      "rating": {
        "average_rating": "float",
        "total_votes": "int"
      },
      "certification": "str",
      "cast": [
        {
          "actor_name": "str",
          "role": "str"
        }
      ],
      "crew": [
        {
          "crew_name": "str",
          "role": "str"
        }
      ]
    }
  }'
```

## Notes

- Costs **6 credits** per successful request.
- Parses HTML into JSON automatically using AI.
- You define the desired data structure — the AI fills it in.
- Ideal for dynamic pages or unknown HTML structures.
