---
title: "Get the number of opted-in and opted-out image URLs in a dataset."
method: GET
path: "/opt-in-out-urls"
---

# Get the number of opted-in and opted-out image URLs in a dataset.

`GET /opt-in-out-urls`

Based on the API of spawning.ai, returns the number of image URLs that have been opted-in and opted-out. Use the optional config and split parameters to filter the response. Only a sample of the rows is scanned, the first 100K rows at the moment.

## Query parameters

- `dataset` string, required
- `config` string
- `split` string

## Response `200`

The number of opted-in and opted-out image URLS in the dataset.

- OptInOutUrlsCountResponse
  - `urls_columns` string[], required
  - `num_opt_in_urls` integer, required
  - `num_opt_out_urls` integer, required
  - `num_urls` integer, required
  - `num_scanned_rows` integer, required
  - `has_urls_columns` boolean, required
  - `full_scan` boolean, nullable, required

## Other responses

- `401` — If the external authentication step on the Hugging Face Hub failed, and no authentication mechanism has been provided. Retry with authentication.
- `404` — If the repository to download from cannot be found, or if the config or split does not exist in the dataset. Note that this may be because the dataset doesn't exist, or because it is set to `private` and you do not have access.
- `422` — The 'dataset' parameter has not been provided or is invalid.
- `500` — The server crashed, the response still hasn't been generated (the process is asynchronous), or the response couldn't be generated successfully due to an error in the dataset itself. The client can retry after a time, in particular in the case of the response still being processed. If the error does not vanish, it's possibly due to a bug in the API software or in the dataset, and should be reported.
- `501` — The server does not implement the feature.

---

[API](https://skmtc.net/huggingface/apis/dataset-viewer-server-api.md) · [All operations](https://skmtc.net/huggingface/apis/dataset-viewer-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/dataset-viewer-server-api/versions/5048b8c0f4f9/schema)
