# Get Site

GET https://api.webflow.com/v2/sites/{site_id}

Get details of a site.

Required scope | `sites:read`


Reference: https://developers.webflow.com/data/reference/sites/get

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Get Site
  version: endpoint_sites.get
paths:
  /sites/{site_id}:
    get:
      operationId: get
      summary: Get Site
      description: |
        Get details of a site.

        Required scope | `sites:read`
      tags:
        - - subpackage_sites
      parameters:
        - name: site_id
          in: path
          description: Unique identifier for a Site
          required: true
          schema:
            type: string
            format: objectid
        - name: Authorization
          in: header
          description: >-
            Bearer authentication of the form `Bearer <token>`, where token is
            your auth token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Request was successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sites_get_Response_200'
        '400':
          description: Request body was incorrectly formatted.
          content: {}
        '401':
          description: >-
            Provided access token is invalid or does not have access to
            requested resource
          content: {}
        '404':
          description: Requested resource not found
          content: {}
        '429':
          description: >-
            The rate limit of the provided access_token has been reached. Please
            have your application respect the X-RateLimit-Remaining header we
            include on API responses.
          content: {}
        '500':
          description: We had a problem with our server. Try again later.
          content: {}
components:
  schemas:
    SitesSiteIdGetResponsesContentApplicationJsonSchemaCustomDomainsItems:
      type: object
      properties:
        id:
          type: string
          format: objectid
          description: Unique identifier for the Domain
        url:
          type: string
          description: The registered Domain name
        lastPublished:
          type:
            - string
            - 'null'
          format: date-time
          description: The date the custom domain was last published to
      required:
        - id
    SitesSiteIdGetResponsesContentApplicationJsonSchemaLocalesPrimary:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the locale.
        cmsLocaleId:
          type: string
          description: A CMS-specific identifier for the locale.
        enabled:
          type: boolean
          description: Indicates if the locale is enabled.
        displayName:
          type: string
          description: The display name of the locale, typically in English.
        displayImageId:
          type:
            - string
            - 'null'
          description: An optional ID for an image associated with the locale, nullable.
        redirect:
          type: boolean
          description: Determines if requests should redirect to the locale's subdirectory.
        subdirectory:
          type: string
          description: The subdirectory path for the locale, used in URLs.
        tag:
          type: string
          description: >-
            A tag or code representing the locale, often following a standard
            format like 'en-US'.
    SitesSiteIdGetResponsesContentApplicationJsonSchemaLocalesSecondaryItems:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the locale.
        cmsLocaleId:
          type: string
          description: A CMS-specific identifier for the locale.
        enabled:
          type: boolean
          description: Indicates if the locale is enabled.
        displayName:
          type: string
          description: The display name of the locale, typically in English.
        displayImageId:
          type:
            - string
            - 'null'
          description: An optional ID for an image associated with the locale, nullable.
        redirect:
          type: boolean
          description: Determines if requests should redirect to the locale's subdirectory.
        subdirectory:
          type: string
          description: The subdirectory path for the locale, used in URLs.
        tag:
          type: string
          description: >-
            A tag or code representing the locale, often following a standard
            format like 'en-US'.
    SitesSiteIdGetResponsesContentApplicationJsonSchemaLocales:
      type: object
      properties:
        primary:
          $ref: >-
            #/components/schemas/SitesSiteIdGetResponsesContentApplicationJsonSchemaLocalesPrimary
          description: The primary locale for the site or application.
        secondary:
          type: array
          items:
            $ref: >-
              #/components/schemas/SitesSiteIdGetResponsesContentApplicationJsonSchemaLocalesSecondaryItems
          description: A list of secondary locales available for the site or application.
    SitesSiteIdGetResponsesContentApplicationJsonSchemaDataCollectionType:
      type: string
      enum:
        - value: always
        - value: optOut
        - value: disabled
    sites_get_Response_200:
      type: object
      properties:
        id:
          type: string
          format: objectid
          description: Unique identifier for the Site
        workspaceId:
          type: string
          format: objectid
          description: Unique identifier for the Workspace
        createdOn:
          type: string
          format: date-time
          description: Date the Site was created
        displayName:
          type: string
          description: Name given to Site
        shortName:
          type: string
          description: Slugified version of name
        lastPublished:
          type: string
          format: date-time
          description: Date the Site was last published
        lastUpdated:
          type: string
          format: date-time
          description: Date the Site was last updated
        previewUrl:
          type: string
          format: uri
          description: URL of a generated image for the given Site
        timeZone:
          type: string
          description: Site timezone set under Site Settings
        parentFolderId:
          type:
            - string
            - 'null'
          format: objectid
          description: The ID of the parent folder the Site exists in
        customDomains:
          type: array
          items:
            $ref: >-
              #/components/schemas/SitesSiteIdGetResponsesContentApplicationJsonSchemaCustomDomainsItems
        locales:
          $ref: >-
            #/components/schemas/SitesSiteIdGetResponsesContentApplicationJsonSchemaLocales
        dataCollectionEnabled:
          type: boolean
          description: Indicates if data collection is enabled for the site.
        dataCollectionType:
          $ref: >-
            #/components/schemas/SitesSiteIdGetResponsesContentApplicationJsonSchemaDataCollectionType
          description: The type of data collection enabled for the site.
      required:
        - id

```

## SDK Code Examples

```python
from webflow import Webflow

client = Webflow(
    access_token="YOUR_ACCESS_TOKEN",
)
client.sites.get(
    site_id="580e63e98c9a982ac9b8b741",
)

```

```typescript
import { WebflowClient } from "webflow-api";

const client = new WebflowClient({ accessToken: "YOUR_ACCESS_TOKEN" });
await client.sites.get("580e63e98c9a982ac9b8b741");

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.get("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
var client = new RestClient("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```