Website Analysis

Review and find critical information about a website

In addition to our Web Presence route, there are two methods for requesting a website analysis:

  1. As part of a business search
  2. Independently analyzing a URL

1. Part of a business search

Initial Search Request

If a business search included Order.WebsiteAnalysis as an option, once the business search has been completed the user can retrieve the details of Baselayer's website analysis results.

Example payload for a business search including the option for website analysis:

{
  "options": [
    "Order.WebsiteAnalysis"
  ],
  "name": "White, Floyd and Cook",
  "address": "155 Carla Circles Jordanfurt, OK 59066"
}
  

As part of the POST response, Baselayer will return the array orderables, which includes all the associated requests that were made as a result of ordering optional features through the options when the search was submitted. This will include a corresponding WebsiteAnalysisRequest orderable containing the ID and URL for the forthcoming associated operations.

Example response:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "options": "Order.WebsiteAnalysis",
  "orderables": [
    {
      "id": "3f88c055-7bb9-4840-8c5e-c7b30756ca58",
      "option": "Order.WebsiteAnalysis",
      "type": "WebsiteAnalysisRequest",
      "url": "https://api.baselayerhq.com/website_analysis_requests/3f88c055-7bb9-4840-8c5e-c7b30756ca58"
    }
  ],
  "user": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "first_name": "Austin",
    "last_name": "Taylor",
    "email": "[email protected]"
  },
  "state": "COMPLETED",
  ...
}

Website Analysis Request

Once the business search is completed, you can retrieve the website analysis results using the ID from the associated orderable, using [GET /website_analysis_requests/{id}](https://docs.baselayer.com/reference/get_website_analysis_request_website_analysis_requests__id__get) or by listening for the webhook event [WebsiteAnalysisRequest.completed](https://docs.baselayer.com/reference/website_analysis_completedwebsiteanalysisrequest_completed_post)



2. Independent URL Analysis

You can also submit a website analysis request against a URL.

To start a request, simply make a POST request to /web_presence_requests using the URL of the website you wish to analyze.

When the status of the request is COMPLETED, the response of the POST /website_analysis_requests will include a populated UUID under the field id, associated with the specific website analysis request. It will also include the complete information of the website analysis (under the object website_analysis).

That UUID can then be used as the input for [GET /website_analysis_requests/{id}](https://docs.baselayer.com/reference/get_website_analysis_request_website_analysis_requests__id__get) to retrieve all information at a later time. The GET request does not contain any additional information compared to the response of the POST request.



Website Analysis Screenshot

As part of the website analysis request, Baselayer takes a screenshot of the website analyzed. You can retrieve the screenshot using the UUID from the request, using GET /website_analysis/{id}/screenshot.


What’s Next