<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BUG search api https://esearchapi.esri.com/search in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/bug-search-api-https-esearchapi-esri-com-search/m-p/1576714#M7401</link>
    <description>&lt;P&gt;I got it working by using a session in python.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def bug_search(max_return = 20):
    url = r"https://esearchapi.esri.com/search"
    MAX_PAGE_LEN = 5
    results = []
    session = requests.Session()
    headers = {
        "Accept": "application/json, text/plain, */*",
        "Accept-Encoding": "gzip, deflate, br, zstd",
        "Accept-Language": "en-US,en;q=0.9,en-AU;q=0.8",
        "Origin": "https://support.esri.com",
        "Referer": "https://support.esri.com/",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Site": "same-site",
        "sec-ch-ua": '"Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": '"Windows"'
    }
    session.headers.update({
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
    })
    for offset in range(0, max_return, MAX_PAGE_LEN):
        if offset + MAX_PAGE_LEN &amp;gt; max_return:
            offset = max_return - MAX_PAGE_LEN

        data = {
            "num": MAX_PAGE_LEN,
            "client": "support_all",
            "start": offset,
            "site": "support_bug_articles",
            "format": "json",
            "len": max_return,
            "lr": "en",
            "index": "support_all",
            "_source": {
                "excludes": [
                    "content",
                    "meta",
                    "connectorSpecific"
                ]
            },
            "q": "",
            "sort": "metaFields.date-sort:D",
             "partialfields": "version:11%2E3"
        }
       

        response = session.post(url, headers=headers, json=data)
        hits = response.json()["search"]["hits"]
        results.extend([json.dumps(i) for i in hits])
    results = [json.loads(i) for i in set(results)]

    return results&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 17 Jan 2025 02:52:20 GMT</pubDate>
    <dc:creator>LHo</dc:creator>
    <dc:date>2025-01-17T02:52:20Z</dc:date>
    <item>
      <title>BUG search api https://esearchapi.esri.com/search</title>
      <link>https://community.esri.com/t5/developers-questions/bug-search-api-https-esearchapi-esri-com-search/m-p/1576699#M7400</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm trying to use this function to search for bugs online&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def bug_search():
    url = r"https://esearchapi.esri.com/search"
    data = {
        "num": 15,
        "client": "support_all",
        "start": 0,
        "site": "support_bug_articles",
        "format": "json",
        "len": 100,
        "lr": "en",
        "index": "support_all",
        "_source": {
            "excludes": [
                "content",
                "meta",
                "connectorSpecific"
            ]
        },
        "q": "",
        "sort": "metaFields.date-sort:D",
        "partialfields": "version:11%2E3"
    }
    response = requests.post(url=url, data=json.dumps(data))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; It only returns 10 hits in the response&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The response seems to be ignoring the offset value&lt;/P&gt;&lt;P&gt;3. There is a lot of non English language in the response even though "lr" = "en".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone point me in the right direction to properly query this api?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 00:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/bug-search-api-https-esearchapi-esri-com-search/m-p/1576699#M7400</guid>
      <dc:creator>LHo</dc:creator>
      <dc:date>2025-01-17T00:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: BUG search api https://esearchapi.esri.com/search</title>
      <link>https://community.esri.com/t5/developers-questions/bug-search-api-https-esearchapi-esri-com-search/m-p/1576714#M7401</link>
      <description>&lt;P&gt;I got it working by using a session in python.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def bug_search(max_return = 20):
    url = r"https://esearchapi.esri.com/search"
    MAX_PAGE_LEN = 5
    results = []
    session = requests.Session()
    headers = {
        "Accept": "application/json, text/plain, */*",
        "Accept-Encoding": "gzip, deflate, br, zstd",
        "Accept-Language": "en-US,en;q=0.9,en-AU;q=0.8",
        "Origin": "https://support.esri.com",
        "Referer": "https://support.esri.com/",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Site": "same-site",
        "sec-ch-ua": '"Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": '"Windows"'
    }
    session.headers.update({
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
    })
    for offset in range(0, max_return, MAX_PAGE_LEN):
        if offset + MAX_PAGE_LEN &amp;gt; max_return:
            offset = max_return - MAX_PAGE_LEN

        data = {
            "num": MAX_PAGE_LEN,
            "client": "support_all",
            "start": offset,
            "site": "support_bug_articles",
            "format": "json",
            "len": max_return,
            "lr": "en",
            "index": "support_all",
            "_source": {
                "excludes": [
                    "content",
                    "meta",
                    "connectorSpecific"
                ]
            },
            "q": "",
            "sort": "metaFields.date-sort:D",
             "partialfields": "version:11%2E3"
        }
       

        response = session.post(url, headers=headers, json=data)
        hits = response.json()["search"]["hits"]
        results.extend([json.dumps(i) for i in hits])
    results = [json.loads(i) for i in set(results)]

    return results&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Jan 2025 02:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/bug-search-api-https-esearchapi-esri-com-search/m-p/1576714#M7401</guid>
      <dc:creator>LHo</dc:creator>
      <dc:date>2025-01-17T02:52:20Z</dc:date>
    </item>
  </channel>
</rss>

