> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Profile Table

Return column-level row counts, null counts, distinct counts, ranges, and sample
values for a CSV-backed table.

<RequestExample>
  ```python Python theme={null}
  from retab import Retab

  client = Retab()

  profile = client.tables.profile(table_id="tbl_123", select=["countrycode"])
  print(profile)
  ```

  ```typescript TypeScript theme={null}
  import { Retab } from "@retab/node";

  const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

  const profile = await client.tables.profile("tbl_123", { select: ["countrycode"] });
  console.log(profile);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	retab "github.com/retab-dev/retab/clients/go"
  )

  func main() {
  	ctx := context.Background()

  	client, err := retab.NewClient("")
  	if err != nil {
  		log.Fatal(err)
  	}

  	profile, err := client.Tables.Profile(ctx, "tbl_123", &retab.TablesProfileParams{
  		Select: []string{"countrycode"},
  	})
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(*profile)
  }
  ```

  ```ruby Ruby theme={null}
  require 'retab'

  client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

  profile = client.tables.profile(table_id: 'tbl_123', select: ['countrycode'])
  puts profile
  ```

  ```rust Rust theme={null}
  use retab::resources::tables::ProfileParams;
  use retab::Retab;

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let client = Retab::new(std::env::var("RETAB_API_KEY")?);

      let profile = client
          .tables()
          .profile(
              "tbl_123",
              ProfileParams {
                  select: Some(vec!["countrycode".to_string()]),
              },
          )
          .await?;
      println!("{:?}", profile);
      Ok(())
  }
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  use Retab\Client;

  $client = new Client(apiKey: getenv('RETAB_API_KEY'));

  $result = $client->tables()->profile(
      tableId: 'tbl_123',
      select: ['countrycode'],
  );
  print_r($result);
  ```

  ```csharp C# theme={null}
  using Retab;
  using RetabClient = Retab.Retab;

  var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
  var client = new RetabClient(apiKey);

  var result = await client.Tables.ProfileAsync("tbl_123", new TablesProfileOptions
  {
      Select = new List<string> { "countrycode" },
  });
  Console.WriteLine(result);
  ```

  ```java Java theme={null}
  import com.retab.RetabClient;
  import java.util.List;

  public final class Example {
    public static void main(String[] args) throws Exception {
      RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

      var result = client.tables().profile("tbl_123", List.of("countrycode"));
      System.out.println(result);
    }
  }
  ```

  ```bash cURL theme={null}
  curl "https://api.retab.com/v1/tables/tbl_123/profile?select=countrycode" \
    -H "Authorization: Bearer $RETAB_API_KEY"
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/tables/{table_id}/profile
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/tables/{table_id}/profile:
    get:
      tags:
        - Tables
      summary: Table.Get Profile
      operationId: profile_table
      parameters:
        - in: path
          name: table_id
          required: true
          schema:
            type: string
            title: Table Id
        - in: query
          name: select
          schema:
            items:
              type: string
            type: array
            title: Select
            default: []
          required: false
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowTableProfileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowTableProfileResponse:
      properties:
        table_id:
          type: string
          title: Table Id
        row_count:
          type: integer
          title: Row Count
        columns:
          items:
            $ref: '#/components/schemas/WorkflowTableProfileColumn'
          type: array
          title: Columns
          default: []
      type: object
      required:
        - row_count
        - table_id
      title: WorkflowTableProfileResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    WorkflowTableProfileColumn:
      properties:
        name:
          type: string
          title: Name
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
          default: {}
        row_count:
          type: integer
          title: Row Count
        null_count:
          type: integer
          title: Null Count
        empty_count:
          type: integer
          title: Empty Count
        distinct_count:
          type: integer
          title: Distinct Count
        min:
          title: Min
          default: null
        max:
          title: Max
          default: null
        sample_values:
          items:
            type: string
          type: array
          title: Sample Values
          default: []
        is_estimated:
          type: boolean
          title: Is Estimated
          default: false
      type: object
      required:
        - distinct_count
        - empty_count
        - name
        - null_count
        - row_count
      title: WorkflowTableProfileColumn
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          default: null
        ctx:
          type: object
          title: Context
          default: {}
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````