Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compression count not return #36

Open
arirah opened this issue Jan 13, 2025 · 2 comments
Open

Compression count not return #36

arirah opened this issue Jan 13, 2025 · 2 comments

Comments

@arirah
Copy link

arirah commented Jan 13, 2025

I am trying to get a compressed count with this line!

\Tinify\setKey('YOUR_API_KEY');
$compressionsThisMonth = \Tinify\compressionCount();

But it returns an empty value!

@PabloPerezDeCiriza
Copy link

Hi @arirah!

Thanks for reaching out!

You can get the compression count after you have validated your API key or after you have made at least one compression request. So you can try this for example.

    \Tinify\setKey('YOUR_API_KEY');
    \Tinify\validate();
    $count = \Tinify\compressionCount();
    echo "Compressions this month: $count\n";

I hope this solves your issues. Have a nice day.

@arirah
Copy link
Author

arirah commented Jan 13, 2025

Thanks @PabloPerezDeCiriza! It is working!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants