The PDF Search allows you to search for PDF books based on provided keywords and retrieve relevant PDF links.

Base URL

"https://openapi-idk8.onrender.com"

Endpoints

  • GET /pdf: Searches for PDF books based on the provided keywords and returns relevant PDF links.

Query Parameters

  • find (string): The keyword(s) to search for PDF books. This parameter is required.
  • count (integer): The number of PDF links to return (default is 5). This parameter is optional.

Sample Request

GET `https://openapi-idk8.onrender.com/pdf?find=Programming+Language&count=10`

Sample Response

{
  "api_name": "PDF Search - The PDF Book Finder API",
  "description": "An API to find PDF books based on provided keywords.",
  "author": "OpenAPI",
  "query": "programming language",
  "results_count": 10,
  "results": [
    {
      "title": "Programming Language Concepts",
      "url": "https://example.com/programming-language-concepts.pdf",
      "snippet": "A comprehensive guide to programming language concepts and principles."
    },
    {
      "title": "Advanced Programming Languages",
      "url": "https://example.com/advanced-programming-languages.pdf",
      "snippet": "Exploring advanced concepts in programming languages."
    },
    ...
  ]
}

Error Handling

If there is an error or a required parameter is missing or invalid, the API responds with an appropriate error message and status code.

Authentication

The API requires authentication using an API key in the authorization header. Include the API key as follows:

const apiKey = 'Bearer OpenAPIT3BlbkFQSQ';

Include the API key in the authorization header of your request to authenticate and access the API resources.

(Node.js)

const axios = require('axios');

// API Key for authentication
const apiKey = 'Bearer OpenAPIT3BlbkFQSQ';

const fetchPDFLinks = async (find, count = 5) => {
    const searchUrl = `http://localhost:3000/pdf?find=${encodeURIComponent(find)}&count=${count}`;

    try {
        const response = await axios.get(searchUrl, {
            headers: {
                Authorization: apiKey // Include API key in the authorization header
            }
        });
        return response.data;
    } catch (error) {
        console.error('Error:', error);
        return [];
    }
};

// Example usage
const query = 'programming language';
const count = 10;
fetchPDFLinks(query, count)
    .then(data => console.log(data))
    .catch(error => console.error(error));