> For the complete documentation index, see [llms.txt](https://docs.adsecure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adsecure.com/docs/guides/understanding-analysis-results.md).

# Understanding analysis results

First of all, let's prepare our next query in order to fetch the Analysis results.

By using the `id` returned in the response body, we can retrieve the [`Analysis`](/api/graphql/analysis.md)'s entry that we've just created. We're also asking the GraphQL API to return us some extra information accessible in this document such as the [`Analysis`](/api/graphql/analysis.md)'s [`Status`](/api/graphql/enums.md#status) or the listing of the [violations](/docs/development/concepts.md#violation) that the [crawler](/docs/development/concepts.md#crawler) could have identified.

[As retrieving an entry in GraphQL](/docs/graphql/forming-calls.md#about-query-and-mutation-operations) is associated to a simple `query`, the following payload should be used:

**Query**

```bash
query {
  analysis(id: "YW5hbHlzaXN8YThiYzk0M2ItNTY3ZS00NzA5LWIwOWItMTI1YmMzNGMxMjUwfDIwMTgtMDktMDI=") {
    id
    content
    status
    violation
    violations
  }
}
```

**Response**

```json
{
  "data": {
    "analysis": {
      "id": "YW5hbHlzaXN8YThiYzk0M2ItNTY3ZS00NzA5LWIwOWItMTI1YmMzNGMxMjUwfDIwMTgtMDktMDI=",
      "content": "https://examples.adsecure.com/simple",
      "status": "DONE",
      "violation": false,
      "violations": []
    }
  }
}
```

The response's body returns a result that mirrors the shape of the requested query. Let's review them one by one:

* `id`: This field is the [`Analysis`](/api/graphql/analysis.md)'s identifier. Unique, it's the one that we got in the response's body of our first query.
* `content`: The content that we asked the AdSecure's [crawler](/docs/development/concepts.md#crawler) to analyse.
* `status`: The [`Analysis`](/api/graphql/analysis.md)'s [`Status`](/api/graphql/enums.md#status). This field has its value set as `DONE` which mean that the analysis was already completed at the time of your query. If you try to get the [`Analysis`](/api/graphql/analysis.md) before its full completion you might see this field set as `INITIAL`. In the same way if an error happens, it will be reflected here by using `ERROR` as value.
* `violation`: If set to `true`, the `violation` field report that the [crawler](/docs/development/concepts.md#crawler) identified one or more [violations](/docs/development/concepts.md#violation). In our example, this field's value is `false`, meaning that the AdSecure's [crawler](/docs/development/concepts.md#crawler) didn't found any violation on the `https://examples.adsecure.com/simple` web page.
* `violations`: This field lists the [violations](/docs/development/concepts.md#violation) found during an analysis. As mentioned previously, no [violations](/docs/development/concepts.md#violation) were found during the analysis and so this array is empty.

## Positive case

Let's now make a new [analysis](/docs/development/concepts.md#analysis), but this time on a content that we know is going to contain some [violations](/docs/development/concepts.md#violation). In this next example, we're going to analyse a web content that is positive for the *Landing Page Error* detection:

```bash
https://examples.adsecure.com/404
```

We're here going to use the same query as the one used previously but updating the `input.content` field with this new content URL.

**Query**

```bash
mutation {
  createAnalysis(input: {
    content: "https://examples.adsecure.com/404"
  }) {
    id
  }
}
```

**Response**

```json
{
  "data": {
    "createAnalysis": {
      "id": "YW5hbHlzaXN8YThiYzI0M2ItNTY3ZS13ZjA5LWIwOWItMTI1YmMzNGMxMzRyfDIwMTgtMDktMDI="
    }
  }
}
```

Our new analysis is now created and we can retrieve it by using the same query as in our first example but replacing the previous `id` by the one generated for this new [`Analysis`](/api/graphql/analysis.md):

**Query**

```bash
query {
  analysis(id: "YW5hbHlzaXN8YThiYzI0M2ItNTY3ZS13ZjA5LWIwOWItMTI1YmMzNGMxMzRyfDIwMTgtMDktMDI=") {
    id
    content
    status
    violation
    violations
  }
}
```

**Response**

```json
{
  "data": {
    "analysis": {
      "id": "YW5hbHlzaXN8YThiYzk0M2ItNTY3ZS00NzA5LWIwOWItMTI1YmMzNGMxMjUwfDIwMTgtMDktMDI=",
      "content": "https://examples.adsecure.com/404",
      "status": "DONE",
      "violation": true,
      "violations": ["landing-page-error"]
    }
  }
}
```

As you can see here, the field `violation` is now set to `true` meaning that at least one [violations](/docs/development/concepts.md#violation) was found by the [crawler](/docs/development/concepts.md#crawler). In order to have more information about it we need to check the field `violations`. Here we see that the array is now containing the `landing-page-error` value which is the identifier of the *Landing Page Error* detection.

Having a detection's identifier listed in this `violations` array means that the AdSecure [crawler](/docs/development/concepts.md#crawler) found some positive results for the corresponding detection during its [analysis](/docs/development/concepts.md#analysis).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adsecure.com/docs/guides/understanding-analysis-results.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
