Search by

datacircle / datacircle-bundle

datacircle

Find the best GTM APIs. A Symfony bundle with a client and console commands for Datacircle's public API. You need no API key.

Package info

github.com/waynehamadi/datacircle-bundle

Homepage

Documentation

Type:symfony-bundle

pkg:composer/datacircle/datacircle-bundle

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-12-01 17:14 UTC

This package is auto-updated.

Last update: 2026-12-01 17:18:45 UTC


README

Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.

https://datacircle.dev

This bundle adds a Datacircle client and four console commands to a Symfony app. The client and the commands call Datacircle's public API, https://api.datacircle.dev/v1. You need no key and no account.

Client method Command Answer Call
apis() datacircle:apis Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan GET /apis
best($slug, $limit) datacircle:best One API's plans, sorted by score out of 100, best first. Each plan comes with a rank and a price per 1,000 calls GET /apis/{slug}/best
plans($api, $query, $sort, $limit, $offset) datacircle:plans Plans that match a provider name or plan name. Search all APIs or one API. Sort the plans by score, provider or price GET /plans
provider($provider, $plans) datacircle:provider The APIs a provider sells, and the provider's rank on each API GET /providers/{slug}

Install

composer require datacircle/datacircle-bundle

The bundle needs PHP 8.1 or later and Symfony 6.4, 7 or 8. Symfony Flex adds the bundle to config/bundles.php. Without Flex, add this line to config/bundles.php yourself:

Datacircle\DatacircleBundle\DatacircleBundle::class => ['all' => true],

Commands

bin/console datacircle:apis
bin/console datacircle:best email-finder --limit=5
bin/console datacircle:plans hunter --api=email-finder --sort=price
bin/console datacircle:provider "Bright Data" --best
  • datacircle:apis lists every API and the API's slug. Use the slug in datacircle:best.
  • datacircle:best <slug> shows the API's best plans. --limit takes 1 to 50 plans, 10 by default.
  • datacircle:plans [<query>] searches plans by provider name and plan name. A match needs each word of the query in the provider name or the plan name. --api shows only the plans of one API. Give the API's name or slug. --sort takes score (the default), provider or price. Use --limit and --offset to page through the plans.
  • datacircle:provider <provider> takes the provider's slug or name. --best adds the provider's best plan on each API.

Add --json to any command to print the Datacircle API's answer as JSON.

The client

Symfony autowires Datacircle\DatacircleBundle\DatacircleClient in your controllers and services:

namespace App\Controller;

use Datacircle\DatacircleBundle\DatacircleClient;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;

final class GtmController extends AbstractController
{
    #[Route('/gtm/best/{slug}')]
    public function best(DatacircleClient $datacircle, string $slug): JsonResponse
    {
        return $this->json($datacircle->best($slug, limit: 3));
    }
}

The four methods:

$apis = $datacircle->apis();

$best = $datacircle->best('email-finder', limit: 3);
foreach ($best['plans'] as $plan) {
    echo $plan['rank'], ' ', $plan['provider'], ' ', $plan['plan'], ' ', $plan['score'], ' $', $plan['perThousand'], PHP_EOL;
}

$cheapest = $datacircle->plans(api: 'email-finder', sort: 'price', limit: 5);

$ranks = $datacircle->provider('Bright Data', plans: 'none');

Each method returns the API's JSON answer as an array. A plan has about 90 keys. The keys give the provider, plan name, score and price per 1,000 calls (perThousand, in dollars). Other keys give the rate limits, speed and fields. Read https://datacircle.dev/fields for the meaning of each key.

provider() gives the provider's plans on each API. With plans: 'best', you get only the best plan on each API. plans: 'none' gives the ranks with no plans. Bright Data has plans on more than 60 APIs. Use plans: 'best' or plans: 'none' for a shorter answer.

Errors

The client throws Datacircle\DatacircleBundle\ApiError on a 4xx answer, like an unknown slug or a limit over 50. The error message holds the API's own words. The status property holds the HTTP status. The body property holds the API's answer. After an unknown slug, body['slugs'] lists every valid slug. On any other failure, like a network error or a 5xx answer, the client throws a RuntimeException. Each console command prints the error and exits with code 1.

Config

The client calls https://api.datacircle.dev/v1 through your app's http_client service. The client waits 30 seconds for an answer. To change the URL, the timeout or the HTTP client, add config/packages/datacircle.yaml:

datacircle:
    base_url: 'https://api.datacircle.dev/v1'
    timeout: 30
    http_client: null

All three keys are optional. timeout is in seconds. http_client takes the id of another HTTP client service, like a scoped client of yours. bin/console config:dump-reference datacircle prints the keys and the defaults.

Tests

In a unit test, give the client a MockHttpClient:

use Datacircle\DatacircleBundle\DatacircleClient;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;

$datacircle = new DatacircleClient(new MockHttpClient(
    new JsonMockResponse([['api' => 'Employee email', 'slug' => 'email-finder']]),
));

$this->assertSame('email-finder', $datacircle->apis()[0]['slug']);

In a kernel test, set the mock_response_factory option of framework.http_client. The bundle calls through the app's http_client. So your mock answers the bundle's calls too.

Network

Each method makes one HTTPS GET request to https://api.datacircle.dev/v1 and nothing else. The request holds only the method's own arguments: no key and nothing from your app or your app's users. Symfony's HTTP client asks for gzip. The API sends large answers compressed. The API takes up to 60 calls a minute from one IP address. The API can ask the client to wait. The client then waits once, for a minute at most. The bundle stores nothing.

Links

MIT license.