pagination

API pagination loop

API pagination loop Question: I have successfully created a loop to paginate an API I am working with. My challenge is on concatenating the dataframes once I am done with the loop so that I have one solid dataframe. Any help will go a long way. import requests import json import pandas as pd from …

Total answers: 2

How to paginate search with YouTube Data Api on Python?

How to paginate search with YouTube Data Api on Python? Question: I need to analyze all id’s from search and in order 50 maxResults is not relevant for me, im trying to increase number of retrieved data by pagination. I want to understand how to do that. Here is how my code look like: api_key …

Total answers: 1

How i can realize multiple pagination(drf)

How i can realize multiple pagination(drf) Question: If I’ll send get request like thisenter image description here, i need to have multiple pagination (LimitOffset and PageNumber). models.py: from django.db import models class Products(models.Model): title = models.CharField(max_length=255) description = models.TextField(blank=True) photo = models.ImageField(upload_to="photos/%Y/%m/%d/", null=True) hashtag = models.CharField(max_length=255) is_hit = models.BooleanField(default=False) category = models.ForeignKey(‘Category’, on_delete=models.PROTECT, null=True) def …

Total answers: 1

Pulling paginated json data with python / loop

Pulling paginated json data with python / loop Question: I pulled json data with api. Response example as below. { "page": 1, "pages": 5, "limit": 100, "count": 466, "records": [ { "epoch": "9b4WLoXXYgga9mGRLGsWKu", "last_height": 5402, "last_time": "2021-02-22T01:02:43.011692Z", "expected_blocks": 432, "produced_blocks": 432, } ] } But page is limited with 100 rows. Parameters query is available …

Total answers: 1

Pagination of search results only in Django not working

Pagination of search results only in Django not working Question: I have implemented a search bar and function into a django web app in the following view: def search_products(request): search_query = request.GET.get(‘search’, ”) products = Product.objects.filter(Q(name__icontains=search_query) | Q(brand__icontains=search_query)) paginator = Paginator(products, 40) page_number = request.GET.get(‘page’, 1) page = paginator.get_page(page_number) if page.has_next(): next_url = f’?page={page.next_page_number()}’ else: …

Total answers: 1

Requests – POST pagination?

Requests – POST pagination? Question: i want to get these transactions: https://www.omniexplorer.info/address/1FoWyxwPXuj4C6abqwhjDWdz6D4PZgYRjA The first page is no problem with: import requests headers = { ‘Content-Type’: ‘application/x-www-form-urlencoded’, } data = [(‘addr’, ‘1FoWyxwPXuj4C6abqwhjDWdz6D4PZgYRjA’)] response = requests.post(‘https://api.omniexplorer.info/v1/address/addr/details/’, headers=headers, data=data) response = response.json() print(response[“transactions”]) But how can i call page 2 for example? I tried with params “params = …

Total answers: 4

Pagination with BeautifulSoup

Pagination with BeautifulSoup Question: I am trying to get some data from the following website. https://www.drugbank.ca/drugs For every drug in the table, I will need to go deeply and have the name and some other specific features like categories, structured indication (please click on drug name to see the features I will use). I wrote …

Total answers: 1

django-filter use paginations

django-filter use paginations Question: I’m using the django-filter package to provide a search functionality on my List View. Now I want to add a pagination to that view as well. I’m trying to combine pagination to a filtered queryset, but I have no clue on how to go on. So far, I have tried the …

Total answers: 11

In Flask, what is "request.args" and how is it used?

In Flask, what is "request.args" and how is it used? Question: As a Flask beginner, I can’t understand how request.args is used. I read somewhere that it is used to return values of query string (correct me if I’m wrong) and how many parameters request.args.get() takes. I know that when I have to store submitted …

Total answers: 4

Django Rest Framework pagination extremely slow count

Django Rest Framework pagination extremely slow count Question: I turned pagination on in Django Rest framework and it appears to be incredibly slow. Count looks like the culprit, and is taking hundreds of milliseconds to return each time due to the millions of rows in the tables. I am using postgresql as the database. Is …

Total answers: 6