Laravel: download YouTube, TikTok and Instagram videos
Laravel's HTTP client gives you retries, timeouts and bearer auth in one fluent chain — a natural fit for CrawlFetch.
How it fits together
A controller resolves the URL with Http::withToken(); a queued job downloads the file to a Storage disk so the request returns instantly.
Laravel example
<?phpnamespace App\Services;use Illuminate\Support\Facades\Http;class CrawlFetch{public function resolve(string $url): array{return Http::withToken(config('services.crawlfetch.key'))->timeout(15)->retry(3, 500, throw: false)->get('https://api.crawlfetch.com/v1/resolve', ['url' => $url])->throw()->json();}}
Notes for Laravel
- Add
'crawlfetch' => ['key' => env('CRAWLFETCH_KEY')]toconfig/services.php. - Use
RateLimitedjob middleware to stay inside your plan's limit.
FAQ
Does it work with Laravel Octane?
Yes — there is no per-request state in the service.
Related
Last updated 2026-10-25