It seems a bit strange to want to PDF web pages, but I could see how it would be useful to be able to archive web pages as PDFs. That's what PDFmyURL does, and it has an API.
Alternative products to PDFmyURL
7 alternative and related products to PDFmyURL
Discover your next favorite thing
Product Hunt surfaces the best new products, every day. It's a place for product-loving enthusiasts to share and geek out about the latest mobile apps, websites, hardware projects, and tech creations.