Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joke Search Paginated API #459

Open
swapnil-musale opened this issue Aug 22, 2023 · 3 comments
Open

Joke Search Paginated API #459

swapnil-musale opened this issue Aug 22, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@swapnil-musale
Copy link

swapnil-musale commented Aug 22, 2023

Is your feature request related to a problem? Please describe.

I've build Joke generator app where I'm planning to add Search feature but currently looking at docs can say https://v2.jokeapi.dev/joke/Any?contains=searchString this api return single joke, is there any possibility to get list of joke with corresponding to searchString in pagination form

Describe the solution you'd like

{
  "currentPage": "0",
  "lastPage": "true"
  "searchResult": [
    {
      "category": "Programming",
      "type": "twopart",
      "setup": "Why do programmers wear glasses?",
      "delivery": "Because they need to C#",
      "flags": {
        "nsfw": false,
        "religious": false,
        "political": false,
        "racist": false,
        "sexist": false,
        "explicit": false
      },
      "id": 51,
      "lang": "en"
    }
  ]
}

It will be great if client or api consumer receive the something similar fashion.

Describe alternatives you've considered

Nothing

Additional context

https://github.com/swapnil-musale/JetJoke

@swapnil-musale swapnil-musale added the enhancement New feature or request label Aug 22, 2023
@Sv443
Copy link
Member

Sv443 commented Aug 22, 2023

Hi, you may use the ?amount parameter with a value of up to 10 to get multiple jokes at a time.

@PrateekSingh43
Copy link

this API does not provide pagination. You might need to explore alternative solutions, such as implementing caching and managing jokes on your end and also for the Search Functionality you need to build it at your end

Things to consider

this joke API by @Sv443 has 120 requests per min and a very limited number of jokes, it does not provide a large number of joke libraries so it can cause a challenge when implementing pagination, especially if you have multiple pages and multiple requests. you need to check for the following things
Fetch more jokes per page to reduce request frequency.
Implement caching to store fetched jokes temporarily for reuse.
Handle rate limit errors gracefully by delaying requests or displaying user-friendly messages.
Prioritize fetching jokes for currently viewed pages to ensure smooth pagination.
Offer a simple search feature to minimize excessive pagination and enhance user experience.

Hey, I'm new to web development, and I don't want to provide incorrect information. Please correct me if I'm wrong. I sincerely apologize for any inconvenience.

@swapnil-musale
Copy link
Author

Hi, you may use the ?amount parameter with a value of up to 10 to get multiple jokes at a time.

I think for now this will help me at certain point
Thank you providing such API.
I wish I could contribute to the project but as being Android Dev don't hold any experience in this tech stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants