指定地理位置的查询

本文档介绍了如何将 uule 参数与 SERP API 结合使用来指定搜索的地理位置。这有助于获取特定位置的搜索结果。

地理位置参数​

SERP API 提供了一个可选参数来指定地理位置:

uule(可选):此参数是您要用于搜索的 Google 编码位置。 您可以使用该UULE生成工具生成 UULE 值。UULE 表示地理位置,例如城市或地区。

生成 UULE​

使用 SERP API 时,如果您想要获取特定于位置的搜索结果,可以使用 UULE 参数。 该参数代表特定的地理位置,允许您自定义您的 API 请求。本指南将引导您完成使用hsite-analyzer.pro网站生成 UULE 参数的过程。

第 1 步:访问 UULE 生成器网站​

前往UULE生成网站

第 2 步:输入您想要的位置​

在 UULE 生成器网页上,您将找到一个输入字段的地方或表单,您可以在其中指定所需的地理位置。 输入您要用于搜索的城市、地区或位置的名称。

第 3 步:生成 UULE​

单击网站上的“生成”按钮或类似功能。该工具将处理您的输入并生成与指定位置关联的 UULE 值。

第4步:复制生成的UULE​

生成 UULE 后,您通常会看到它显示在网站界面上。它可能显示为一串字符。单击 UULE 或使用提供的按钮将其复制到剪贴板。

第 5 步:在 API 请求中使用生成的 UULE

或者

使用 uule 参数

要使用特定地理位置自定义 SERP API 请求,请在 GET 请求中包含 uule 参数。 这是使用各种编程语言的示例:

  • Bash

  • Javascript

  • Python

  • Go

curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&uule=w+CAIQICIFcGFyaXM' \
-H 'Accept: application/json' \
-H 'Authorization: Basic base64(username:password)'

Also, you can just write area, city or a country and we will automatically convert it into UULE

  • Bash

  • Javascript

  • Python

  • Go

curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&uule=paris' \
-H 'Accept: application/json' \
-H 'Authorization: Basic base64(username:password)'

API 响应

API 将使用包含搜索结果的 JSON 对象进行响应。 以下是响应的示例:

{
    "url": "https://www.google.com/search?q=news&uule=w+CAIQICIFcGFyaXM",
    "general": {
        "searchEngine": "google",
        "resultsCount": 25270000000,
        "searchTime": 0.3,
        "mobile": false,
        "searchType": "text",
        "pageTitle": "news - Google Search",
        "timestamp": "2023-10-01T13:02:25.178Z"
    },
    "input": {
        "originalUrl": "https://www.google.com/search?q=news&uule=w+CAIQICIFcGFyaXM",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
        "jobId": "7afabd61-1b55-4570-b852-5d03428be51b"
    },
    "organic": [
        {
            "title": "Google News",
            "description": "6 hours ago — Comprehensive up-to-date news coverage, aggregated from sources all over the world by Google News.",
            "link": "https://news.google.com/",
            "displayLink": "https://news.google.com",
            "rank": 1,
            "globalRank": 1
        },
        {
            "title": "NBC News - Breaking News & Top Stories - Latest World, US ...",
            "description": "Go to NBCNews.com for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.",
            "link": "https://www.nbcnews.com/",
            "displayLink": "https://www.nbcnews.com",
            "rank": 2,
            "globalRank": 2
        },
        {
            "title": "CNN: Breaking News, Latest News and Videos",
            "description": "7 hours ago — View the latest news and breaking news today for U.S., world, weather, entertainment, politics and health at CNN.com.",
            "link": "https://www.cnn.com/",
            "displayLink": "https://www.cnn.com",
            "rank": 3,
            "globalRank": 3
        },
        {
            "title": "Fox News - Breaking News Updates | Latest News Headlines ...",
            "description": "23 hours ago — Breaking News, Latest News and Current News from FOXNews.com. Breaking news and video. Latest Current News: U.S., World, Entertainment, ...",
            "link": "https://www.foxnews.com/",
            "displayLink": "https://www.foxnews.com",
            "rank": 4,
            "globalRank": 4
        },
        {
            "title": "ABC News - Breaking News, Latest News and Videos",
            "description": "5 hours ago — Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
            "link": "https://abcnews.go.com/",
            "displayLink": "https://abcnews.go.com",
            "rank": 5,
            "globalRank": 5
        },
        {
            "title": "CBS News - Breaking news, 24/7 live streaming news & top ...",
            "description": "5 hours ago — Watch CBS News live and get the latest, breaking news headlines of the day for national news and world news today.",
            "link": "https://www.cbsnews.com/",
            "displayLink": "https://www.cbsnews.com",
            "rank": 6,
            "globalRank": 6
        },
        {
            "title": "Yahoo News - Latest News & Headlines",
            "description": "7 hours ago — The latest news and headlines from Yahoo! News. Get breaking news stories and in-depth coverage with videos and photos.",
            "link": "https://news.yahoo.com/",
            "displayLink": "https://news.yahoo.com",
            "rank": 7,
            "globalRank": 7
        },
        {
            "title": "Associated Press News: Breaking News, Latest Headlines ...",
            "description": "6 hours ago — Read the latest headlines, breaking news, and videos at APNews.com, the definitive source for independent journalism from every corner of the globe.",
            "link": "https://apnews.com/",
            "displayLink": "https://apnews.com",
            "rank": 8,
            "globalRank": 8
        }
    ],
    "pagination": {
        "currentPage": 1,
        "nextPage": 2,
        "nextPageLink": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=10&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAE",
        "nextPageStart": 10,
        "otherPages": {
            "2": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=10&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAE",
            "3": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=20&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAG",
            "4": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=30&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAI",
            "5": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=40&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAK",
            "6": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=50&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAM",
            "7": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=60&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAO",
            "8": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=70&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAQ",
            "9": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=80&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAS",
            "10": "https://www.google.com/search?q=news&sca_esv=569845833&ei=4G0ZZbL0F9SqptQPrdiLaA&start=90&sa=N&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q8tMDegQIBRAU"
        }
    },
    "related": [
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=Local+news&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgwEAE",
            "text": "local news",
            "rank": 1,
            "globalRank": 9
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=Breaking+news+headlines&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgrEAE",
            "text": "breaking news headlines",
            "rank": 2,
            "globalRank": 10
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=News+Trump&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgpEAE",
            "text": "news trump",
            "rank": 3,
            "globalRank": 11
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=Google+News&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgnEAE",
            "text": "google news",
            "rank": 4,
            "globalRank": 12
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=News+today+in+the+world&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAglEAE",
            "text": "news today in the world",
            "rank": 5,
            "globalRank": 13
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=World+news&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgjEAE",
            "text": "world news",
            "rank": 6,
            "globalRank": 14
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=Define+news&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAghEAE",
            "text": "define news",
            "rank": 7,
            "globalRank": 15
        },
        {
            "listGroup": false,
            "link": "https://www.google.com/search?sca_esv=569845833&q=News+NYC&sa=X&ved=2ahUKEwiy5NSm9NSBAxVUlYkEHS3sAg0Q1QJ6BAgfEAE",
            "text": "news nyc",
            "rank": 8,
            "globalRank": 16
        }
    ]
}

Previous

Last updated