# GET /v1/proofing/suggestions

> Get up to max spelling suggestions for a misspelled word with the word, language and max parameters; each request counts against the spell checking quota.

- **Product:** ReportingCloud
- **Section:** Documentation
- **Kind:** Endpoint
- **Path:** ReportingCloud > API Reference > Web API > Proofing > /suggestions > GET /v1/proofing/suggestions
- **2379 words**
- **Web URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/proofing/suggestions/get/
- **LLMs URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/proofing/suggestions/get/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/proofing/suggestions/get/llms-full.txt

---

`GET` `https://api.reporting.cloud/v1/proofing/suggestions`

### Description

Returns spelling suggestions for a word from a dictionary, at most `max` of them. A correctly spelled word returns itself first. See [Spell Checking](https://docs.textcontrol.com/reporting-cloud/document-processing/spell-checking/llms-full.txt).

> Warning
>
> **Spell Checking Quota.** Each successful request counts 1 against the spell checking quota. It counts 1 also when it returns no suggestions. [Plans and Licensing](https://docs.textcontrol.com/reporting-cloud/overview/licensing/llms-full.txt) lists the quota of each plan.

### Examples

#### HTTP

Request:

```bash
curl -u username:password \
  -X GET "https://api.reporting.cloud/v1/proofing/suggestions?word=Thiss&language=en_US.dic&max=10"
```

Results:

```json
["This","Hiss","Thesis","Thins","Thurs","Thirsts","Thieu","Thirds","Theists","Thais"]
```

#### C#

Request:

```csharp
using System;
using TXTextControl.ReportingCloud;

class RCSamples
{
    public static void GetSuggestions()
    {
        ReportingCloud rc = new ReportingCloud(
            "username",
            "password",
            new Uri("https://api.reporting.cloud"));

        // Get up to 10 suggestions for the misspelled word
        string[] suggestions = rc.GetSuggestions("Thiss", "en_US.dic", 10);

        Console.WriteLine("Suggestions: " + string.Join(", ", suggestions));
    }
}
```

Results:

```text
Suggestions: This, Hiss, Thesis, Thins, Thurs, Thirsts, Thieu, Thirds, Theists, Thais
```

#### Java

Request:

```java
import com.textcontrol.reportingcloud.ReportingCloud;

import java.io.IOException;
import java.util.List;

public class ReportingCloudSample {
    public static void main(String[] args) throws IOException {
        ReportingCloud r = new ReportingCloud("username", "password");
        List<String> suggestions = r.getSuggestions("Thiss", "en_US.dic", 10);

        System.out.println("Suggestions: " + String.join(", ", suggestions));
    }
}
```

Results:

```text
Suggestions: This, Hiss, Thesis, Thins, Thurs, Thirsts, Thieu, Thirds, Theists, Thais
```

#### Ruby

Request:

```ruby
#!/usr/bin/env ruby

require "txtextcontrol/reportingcloud"

reporting_cloud = TXTextControl::ReportingCloud::ReportingCloud.new("username", "password")
suggestions = reporting_cloud.get_suggestions("Thiss", "en_US.dic", 10)

puts "Suggestions: #{suggestions.join(", ")}"
```

Results:

```text
Suggestions: This, Hiss, Thesis, Thins, Thurs, Thirsts, Thieu, Thirds, Theists, Thais
```

#### PHP

Request:

```php
<?php

require_once __DIR__ . '/vendor/autoload.php';

use TextControl\ReportingCloud\ReportingCloud;

$reportingCloud = new ReportingCloud([
    'api_key' => (string) getenv('REPORTINGCLOUD_API_KEY'),
]);

var_dump($reportingCloud->getProofingSuggestions('Thiss', 'en_US.dic', 10));
```

Results:

```text
array(10) {
  [0]=>
  string(4) "This"
  [1]=>
  string(4) "Hiss"
  [2]=>
  string(6) "Thesis"
  [3]=>
  string(5) "Thins"
  [4]=>
  string(5) "Thurs"
  [5]=>
  string(7) "Thirsts"
  [6]=>
  string(5) "Thieu"
  [7]=>
  string(6) "Thirds"
  [8]=>
  string(7) "Theists"
  [9]=>
  string(5) "Thais"
}
```

### Authorization

This endpoint requires a "ReportingCloud-APIKey" or a "Basic" user authorization to access the user account, data and templates. Only one of these two methods is required.

[API Keys](https://docs.textcontrol.com/reporting-cloud/installation/api-keys/llms-full.txt) describes how to create an API key, and [Authentication](https://docs.textcontrol.com/reporting-cloud/document-processing/authentication/llms-full.txt) explains both header forms.

#### ReportingCloud-APIKey

| Header field | Description |
|---|---|
| Authorization | **Required**. A valid ReportingCloud account is required. The Authorization field is constructed as follows: An API key needs to be generated in the portal or with [PUT /v1/account/apikey](https://docs.textcontrol.com/reporting-cloud/reference/web-api/account/apikey/put/llms-full.txt). The authorization method and a space, "ReportingCloud-APIKey ", is then put before the actual API key string. For example: `Authorization: ReportingCloud-APIKey oMDM4MrAqL9QEOpyzupnQW5NjvCNtvE5cVDaaLqxI` |

#### Basic

| Header field | Description |
|---|---|
| Authorization | **Required**. A valid ReportingCloud account is required. The Authorization field is constructed as follows: The user name and password are combined into a string separated by a colon, for example `username:password`. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space, "Basic ", is then put before the encoded string. For example: `Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l` |

### Request Parameters

| Name | Type | Value | Optional |
|---|---|---|---|
| word | String | Specifies the incorrect word that has to be determined for suggestions. An empty word answers 400; for a correctly spelled word the suggestions begin with the word itself, and a text of more than one word returns an empty array. | no |
| language | String | The dictionary that suggests the corrections: one of the names that [/v1/proofing/availabledictionaries](https://docs.textcontrol.com/reporting-cloud/reference/web-api/proofing/availabledictionaries/get/llms-full.txt) returns, such as `en_US.dic`, matched case-sensitively. Another value answers 400. | no |
| max | Integer | Specifies the maximum number of suggestions that has to be determined. The response can hold fewer, as many as the dictionary finds. 0 or a negative number returns an empty array and still counts a proofing transaction; a value that is not a 32-bit integer answers 400. | no |

### Success Response

| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of strings with suggestions. |

### Error Response

| Status | Description |
|---|---|
| 400 | A 400 (Bad Request) with the plain text "Spell checking failed" is returned, if the word is empty, or if the language is empty or not the name of an available dictionary. |
| 400 | A 400 (Bad Request) with the JSON body {"Message":"The request is invalid."} is returned, if max is not a 32-bit integer. |
| 403 | A 403 (Forbidden) is returned, if the user is not authorized or the spell checking quota is exceeded. |
| 404 | A 404 (Not Found) is returned, if a required query parameter is missing. |
| 405 | A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than GET. The Allow header of the response names GET. |
| 500 | A 500 (Internal Server Error) is returned, if the request has no Authorization header, an empty one or one that is not the authorization method, a space and the credentials. |

---

## Nearby

- **Previous:** [/v1/proofing/suggestions](https://docs.textcontrol.com/reporting-cloud/reference/web-api/proofing/suggestions/llms-full.txt)
- **Next:** [Processing](https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/llms-full.txt)
