Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6724513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:41:55+00:00 2026-05-26T09:41:55+00:00

I am trying to write a script that returns just a persons village, town

  • 0

I am trying to write a script that returns just a persons village, town or city. I am using the following YQL query, but the results from the console are too specific, they give me the neighbourhood first.

select * from flickr.places where lat=51.558418 and lon=-1.781985 and api_key=YOU_FLICKR_API_KEY

Here is the results of my query from the console.

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="1" yahoo:created="2011-10-25T09:35:50Z" yahoo:lang="en-US">
    <diagnostics>
        <publiclyCallable>true</publiclyCallable>
        <url execution-start-time="1" execution-stop-time="123" execution-time="122"><![CDATA[http://api.flickr.com/services/rest/?method=flickr.places.findByLatLon&lat=51.558418&lon=-1.781985]]></url>
        <user-time>124</user-time>
        <service-time>122</service-time>
        <build-version>22535</build-version>
    </diagnostics> 
    <results>
        <places accuracy="16" latitude="51.558418" longitude="-1.781985" total="1">
            <place latitude="51.547" longitude="-1.802"
                name="West Leaze, Swindon, England, GB, United Kingdom"
                place_id="sddCvK9SW703gg" place_type="neighbourhood"
                place_type_id="22"
                place_url="/United+Kingdom/England/Swindon/West+Leaze"
                timezone="Europe/London" woeid="39722"/>
        </places>
    </results>
</query>

I want to be able to change the place_type_id in the query. I know I could use regex to isolate the info, but I am not sure if that will work for all locations so I would much prefer to have the API just returning my desired result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:41:56+00:00Added an answer on May 26, 2026 at 9:41 am

    Flickr’s flickr.places.findByLatLon method, which is being called in the background by your YQL query, accepts an accuracy key.

    accuracy (Optional)

    Recorded accuracy level of the location information. World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. The default is 16.

    See » Flickr docs for flickr.places.FindByLatLon.

    Putting that to use is as simple as providing accuracy =n in your where clause. A value of around 10 looks to be about the accuracy that you are looking for, but experiment to see what is best.

    select * from flickr.places where 
    lat=51.558418 and lon=-1.781985 and api_key=API_KEY_HERE
    and accuracy=10
    

    Aside

    Documentation for the data sources / services being used by YQL tables can generally be obtained by looking at the table description.

    desc flickr.places
    

    This gives lots of information, usually including at least one link to documentation pages. See the meta section for the documentationURL items.

    desc flickr.places

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a python script that does the following from within a
I'm trying to write a script that informs the user when someone has logged
I'm trying to write a script that will create a user in MediaWiki, so
I'm trying to write a script that allows an admin of a photo uploading
I'm trying to write a script that will download files from an FTP server.
I'm trying to write a script that searches a directory for files and greps
I'm trying to write a python script that packages our software. This script needs
I'm trying to write a shell script that, when run, will set some environment
I am trying to write a python script that takes record data like this
I am trying to write a PHP script that can upload multiple files. for($i=0;$i<count($_FILES['uploadimg']['name']);$i++){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.