Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 13, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 13, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 13, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 13, 2025

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025

      Microsoft shares rare look at radical Windows 11 Start menu designs it explored before settling on the least interesting one of the bunch

      May 13, 2025

      NVIDIA’s new GPU driver adds DOOM: The Dark Ages support and improves DLSS in Microsoft Flight Simulator 2024

      May 13, 2025

      How to install and use Ollama to run AI LLMs on your Windows 11 PC

      May 13, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Community News: Latest PECL Releases (05.13.2025)

      May 13, 2025
      Recent

      Community News: Latest PECL Releases (05.13.2025)

      May 13, 2025

      How We Use Epic Branches. Without Breaking Our Flow.

      May 13, 2025

      I think the ergonomics of generators is growing on me.

      May 13, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025
      Recent

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025

      Microsoft shares rare look at radical Windows 11 Start menu designs it explored before settling on the least interesting one of the bunch

      May 13, 2025

      NVIDIA’s new GPU driver adds DOOM: The Dark Ages support and improves DLSS in Microsoft Flight Simulator 2024

      May 13, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Lazy JSON Pages is a JSON API Scraper for PHP

    Lazy JSON Pages is a JSON API Scraper for PHP

    November 6, 2024

    Lazy JSON Pages is a JSON API Scraper for PHP

    Lazy JSON Pages is a framework-agnostic API scraper that loads items from any paginated JSON API into a Laravel lazy collection. It is highly customizable, so you can make it work with any PHP project and any JSON API that has paginated results:

    use IlluminateSupportLazyCollection;
    
    $result = LazyCollection::fromJsonPages($source)
        ->totalPages('pagination.total_pages')
        ->async(requests: 3)
        ->throttle(requests: 100, perMinutes: 1)
        ->collect('data.*');
    

    Though Lazy JSON pages return data as a Laravel lazy collection, you can use this package with any PHP project as well. Since it uses Guzzle, you can easily customize client behavior via middleware needed for the target API you’re consuming.

    Main Features

    • Framework-agnostic: Works independently of specific frameworks, but integrates smoothly with Laravel.
    • Async HTTP Requests: Loads items from paginated JSON APIs using asynchronous HTTP requests.
    • Lazy Collection Support: Seamlessly loads API data into Laravel’s lazy collections for efficient memory usage.
    • Handles Pagination: Scrapes and processes paginated APIs without requiring explicit pagination management.
    • Efficient Data Handling: Allows handling large datasets with minimal memory footprint.

    You can learn more about this package, get full installation instructions, and view the source code on GitHub.


    The post Lazy JSON Pages is a JSON API Scraper for PHP appeared first on Laravel News.

    Join the Laravel Newsletter to get all the latest
    Laravel articles like this directly in your inbox.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleUsing certifications to level up your development career
    Next Article AI Regulations for Financial Services: SEC

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 13, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-3744 – Nomad Sentinel Policy Bypass

    May 13, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    The Power of Community Learning in Tech Projects

    Development

    VMware Patches Severe Security Flaws in Workstation and Fusion Products

    Development

    What is Artificial Intelligence (AI)?

    Machine Learning

    CISA Warns of Active Exploitation of Flaws in Zyxel, ProjectSend, and CyberPanel

    Development

    Highlights

    Development

    Researchers at IT University of Copenhagen Propose Self-Organizing Neural Networks for Enhanced Adaptability

    July 8, 2024

    Artificial neural networks (ANNs) traditionally lack the adaptability and plasticity seen in biological neural networks.…

    Laravel Roundup – November

    November 1, 2024

    The best phones for battery life in 2024: Expert tested and reviewed

    December 24, 2024

    Error’d: NaN is the Loneliest Number

    March 21, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.