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

# Check Post Length

> पोस्ट string की भारित लंबाई, या character count की गणना करें

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

Bluesky, Facebook, Google Business Profile, Instagram, LinkedIn, Pinterest, Reddit, Threads, TikTok, X/Twitter, और YouTube के लिए पोस्ट string की भारित लंबाई, या character count की गणना करें। जाँच करता है कि पोस्ट की लंबाई मान्य है और प्रत्येक सोशल नेटवर्क के लिए अनुमत अधिकतम लंबाई लौटाता है।

विशेष characters, जैसे ü, ø, या 😊, का उच्च character count मान (unicode) होता है।

यह जाँच /post endpoint के साथ स्वचालित रूप से की जाती है।

<Info>भारित लंबाई Ayrshare द्वारा गणना किया गया एक अनुमान है। सोशल नेटवर्क्स की अपनी गणना विधियों के आधार पर थोड़े भिन्न character counts हो सकते हैं।</Info>

## Header Parameters

<HeaderAPI noProfileKey={true} />

## Body Parameters

<ParamField body="post" type="string" required>
  लंबाई की गणना करने के लिए पोस्ट string।
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API Key" \
  -H 'Content-Type: application/json' \
  -d '{"post": "🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩"}' \
  -X POST https://api.ayrshare.com/api/post/checkPostWeight
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";
  const post = "🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩";

  fetch("https://api.ayrshare.com/api/post/checkPostWeight", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${API_KEY}`,
    },
    body: JSON.stringify({ post }),
  })
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch(console.error);
  ```

  ```python Python theme={"system"}
  import requests

  payload = {'post': '🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩'}
  headers = {'Content-Type': 'application/json',
          'Authorization': 'Bearer API_KEY'}

  r = requests.post('https://api.ayrshare.com/api/post/checkPostWeight',
      json=payload,
      headers=headers)

  print(r.json())
  ```

  ```php PHP theme={"system"}
  <?php
  require 'vendor/autoload.php';   // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html

  $client = new GuzzleHttp\Client();
  $res = $client->request(
      'POST',
      'https://api.ayrshare.com/api/post/checkPostWeight',
      [
          'headers' => [
              'Content-Type'      => 'application/json',
              'Authorization'     => 'Bearer API_KEY'
          ],
          'json' => [
              'post' => ['🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩']
          ]
      ]
  );

  echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
  ```

  ```csharp C# theme={"system"}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  namespace CheckPostWeightRequest_csharp
  {
      class CheckPostWeight
      {
          static async Task Main(string[] args)
          {
              string API_KEY = "API_KEY";
              string url = "https://api.ayrshare.com/api/post/checkPostWeight";

              using (var httpClient = new HttpClient())
              {
                  httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);

                  var content = new StringContent(
                      "{\"post\" : \"🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩\"}", 
                      Encoding.UTF8, 
                      "application/json"
                  );

                  try
                  {
                      var response = await httpClient.PostAsync(url, content);
                      response.EnsureSuccessStatusCode();
                      string responseBody = await response.Content.ReadAsStringAsync();
                      Console.WriteLine(responseBody);
                  }
                  catch (HttpRequestException e)
                  {
                      Console.WriteLine($"Error: {e.Message}");
                  }
              }
          }
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200: OK Character length results theme={"system"}
  {
      "twitterWeightedLength": 2932,
      "blueskyWeightedLength": 199,
      "instagramWeightedLength": 3015,
      "tikTokWeightedLength": 3017,
      "linkedInWeightedLength": 3015,
      "facebookWeightedLength": 3015,
      "pinterestWeightedLength": 3015,
      "youtubeWeightedLength": 3015,
      "gmbWeightedLength": 3015,
      "twitterValid": false,
      "twitterLongValid": true,
      "facebookValid": true,
      "gmbValid": false,
      "instagramValid": false,
      "linkedInValid": false,
      "pinterestValid": false,
      "redditValid": true,
      "tikTokValid": false,
      "youtubeValid": true,
      "maxCharLimits": {
          "bluesky": 300,
          "facebook": 63206,
          "gmb": 1500,
          "instagram": 2200,
          "linkedin": 3000,
          "pinterest": 500,
          "reddit": 10000,
          "tiktok": 2200,
          "twitter": 280,
          "twitterLong": 25000,
          "youtube": 5000
      }
  }
  ```
</ResponseExample>
