     [Answers](https://scrapfly.io/blog)   /  [data-parsing](https://scrapfly.io/blog/tag/data-parsing)   /  [How to select dictionary key recursively in Python?](https://scrapfly.io/blog/answers/how-to-select-dictionary-key-recursively-in-python)   # How to select dictionary key recursively in Python?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Apr 18, 2023 1 min read [\#data-parsing](https://scrapfly.io/blog/tag/data-parsing) [\#python](https://scrapfly.io/blog/tag/python) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python "Share on LinkedIn")    

 

 

A common challenge when it comes to web scraping JSON data is extracting specific data fields from nested JSON datasets which might be unpredictable. For this, recursive dictionary key selection can be used through tools like [nested-lookup](https://pypi.org/project/nested-lookup/) (`pip install nested-lookup`):

python```python
from nested_lookup import nested_lookup

data = {
    "props-23341s": {
        "information_key_23411": {
            "data": {
                "phone": "+1 555 555 5555",
            }
        }
    }
}
print(nested_lookup("phone", data)[0])
"+1 555 555 5555"
```



nested-lookup is a Python native package for recursive dictionary key lookup or even modification. Though, it's great in web scraping for large JSON Dataset parsing.



 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-select-dictionary-key-recursively-in-python) 



 ## Related Articles

 [  

 python data-parsing 

### Ultimate Guide to JSON Parsing in Python

Learn JSON parsing in Python with this ultimate guide. Explore basic and advanced techniques using json, and tools like ...

 

 ](https://scrapfly.io/blog/posts/how-to-use-python-to-parse-json) [  

 python data-parsing 

### How to Parse Datetime Strings with Python and Dateparser

Dateparser is a popular Python package for parsing datetime strings. Here's how it can be used in web scraping and how t...

 

 ](https://scrapfly.io/blog/posts/parsing-datetime-strings-with-python-and-dateparser) [  

 python data-parsing 

### Introduction to Parsing JSON with Python JSONPath

Intro to using Python and JSONPath library and a query language for parsing JSON datasets.

 

 ](https://scrapfly.io/blog/posts/parse-json-jsonpath-python) 

  ## Related Questions

- [ Q What is cURL and how is it used in web scraping? ](https://scrapfly.io/blog/answers/what-is-curl-and-how-is-it-used-in-web-scraping)
- [ Q How to scrape tables with BeautifulSoup? ](https://scrapfly.io/blog/answers/how-to-scrape-tables-with-beautifulsoup)
- [ Q What are some ways to parse JSON datasets in Python? ](https://scrapfly.io/blog/answers/what-are-some-ways-to-parse-json-datasets-in-python)
- [ Q What are some BeautifulSoup alternatives in Python? ](https://scrapfly.io/blog/answers/what-are-some-beautifulsoup-alternatives)
 
  



   



 Extract structured data with AI, **1,000 free credits** [Start Free](https://scrapfly.io/register)