{"id":18539031,"url":"https://github.com/sfu-db/apiconnectors","last_synced_at":"2025-07-05T17:12:50.361Z","repository":{"id":43840357,"uuid":"224732115","full_name":"sfu-db/APIConnectors","owner":"sfu-db","description":"A curated list of example code to collect data from Web APIs using DataPrep.Connector.","archived":false,"fork":false,"pushed_at":"2023-03-25T00:46:21.000Z","size":1802,"stargazers_count":34,"open_issues_count":14,"forks_count":24,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-03-24T09:46:59.908Z","etag":null,"topics":["configfile","connector","datacollection","dataconnector","dataprep","example","webapis","webdata"],"latest_commit_sha":null,"homepage":"https://github.com/sfu-db/dataprep#connector","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sfu-db.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-28T21:23:40.000Z","updated_at":"2025-03-20T14:07:42.000Z","dependencies_parsed_at":"2022-09-25T01:40:28.836Z","dependency_job_id":null,"html_url":"https://github.com/sfu-db/APIConnectors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfu-db%2FAPIConnectors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfu-db%2FAPIConnectors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfu-db%2FAPIConnectors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfu-db%2FAPIConnectors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sfu-db","download_url":"https://codeload.github.com/sfu-db/APIConnectors/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248078589,"owners_count":21044140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configfile","connector","datacollection","dataconnector","dataprep","example","webapis","webdata"],"created_at":"2024-11-06T19:45:53.444Z","updated_at":"2025-04-09T17:38:04.199Z","avatar_url":"https://github.com/sfu-db.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Collection From Web APIs\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nA curated list of example code to collect data from Web APIs using DataPrep.Connector.\n\n## How to Contribute?\nYou can contribute to this project in two ways. Please check the [contributing guide](CONTRIBUTING.md).\n1. Add your example code on this page\n2. Add a new configuration file to this repo\n\n## Why Contribute?\n* Your contribution will benefit [~100K DataPrep users](https://github.com/sfu-db/dataprep).\n* Your contribution will be recoginized on [Contributors](#contributors-).\n\n## Index\n* [Art](#art)\n* [Business](#business)\n* [Calendar](#calendar)\n* [Crime](#crime)\n* [Finance](#finance)\n* [Geocoding](#geocoding)\n* [Jobs](#jobs)\n* [Lifestyle](#lifestyle)\n* [Music](#music)\n* [Networking](#networking)\n* [News](#news)\n* [Science](#science)\n* [Shopping](#shopping)\n* [Social](#social)\n* [Sports](#sports)\n* [Travel](#travel)\n* [Video](#video)\n* [Weather](#weather)\n\n### Art\n\n#### [Harvard Art Museum](./api-connectors/harvardartmuseum) -- Collect Museums' Collection Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind the objects with dog in their titles and were made in 1990.\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”api_key“ by following https://docs.google.com/forms/d/e/1FAIpQLSfkmEBqH76HLMMiCC-GPPnhcvHC9aJS86E32dOd0Z8MpY2rvQ/viewform\ndc = connect('harvardartmuseum', _auth={'access_token': api_key})\n\ndf = await dc.query('object', title='dog', yearmade=1990)\ndf[['title', 'division', 'classification', 'technique', 'department', 'century', 'dated']]\n  ```\n\n|     | title                       | division                    | classification | technique            | department                | century      | dated |\n| --- | --------------------------- | --------------------------- | -------------- | -------------------- | ------------------------- | ------------ | ----- |\n| 0   | Paris (black dog on street) | Modern and Contemporary Art | Photographs    | Gelatin silver print | Department of Photographs | 20th century | 1990s |\n| 1   | Pregnant Woman with Dog     | Modern and Contemporary Art | Photographs    | Gelatin silver print | Department of Photographs | 20th century | 1990  |\n| 2   | Pompeii Dog                 | Modern and Contemporary Art | Prints         | Drypoint             | Department of Prints      | 20th century | 1990  |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind 10 people that are Dutch.\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”api_key“ by following https://docs.google.com/forms/d/e/1FAIpQLSfkmEBqH76HLMMiCC-GPPnhcvHC9aJS86E32dOd0Z8MpY2rvQ/viewform\ndc = connect('harvardartmuseum', _auth={'access_token': api_key})\n\ndf = await dc.query('person', q='culture:Dutch', size=10)\ndf[['display name', 'gender', 'culture', 'display date', 'object count', 'birth place', 'death place']]\n  ```\n\n|     | display name                    | gender  | culture | display date   | object count | birth place                      | death place            |\n| --- | ------------------------------- | ------- | ------- | -------------- | ------------ | -------------------------------- | ---------------------- |\n| 0   | Joris Abrahamsz. van der Haagen | unknown | Dutch   | 1615 - 1669    | 7            | Arnhem or Dordrecht, Netherlands | The Hague, Netherlands |\n| 1   | François Morellon de la Cave    | unknown | Dutch   | 1723 - 65      | 1            | None                             | None                   |\n| 2   | Cornelis Vroom                  | unknown | Dutch   | 1590/92 - 1661 | 3            | Haarlem(?), Netherlands          | Haarlem, Netherlands   |\n| 3   | Constantijn Daniel van Renesse  | unknown | Dutch   | 1626 - 1680    | 2            | Maarssen                         | Eindhoven              |\n| 4   | Dirck Dalens, the Younger       | unknown | Dutch   | 1654 - 1688    | 3            | Amsterdam, Netherlands           | Amsterdam, Netherlands |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind all exhibitions that take place at a Harvard Art Museums venue after 2020-01-01.\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”api_key“ by following https://docs.google.com/forms/d/e/1FAIpQLSfkmEBqH76HLMMiCC-GPPnhcvHC9aJS86E32dOd0Z8MpY2rvQ/viewform\ndc = connect('harvardartmuseum', _auth={'access_token': api_key})\n\ndf = await dc.query('exhibition', venue='HAM', after='2020-01-01')\ndf\n```\n\n|     | title                                                   | begin date | end date   | url                                                      |\n| --- | ------------------------------------------------------- | ---------- | ---------- | -------------------------------------------------------- |\n| 0   | Painting Edo: Japanese Art from the Feinberg Collection | 2020-02-14 | 2021-07-18 | https://www.harvardartmuseums.org/visit/exhibitions/5909 |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind 5 records for publications that were published in 2013.\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”api_key“ by following https://docs.google.com/forms/d/e/1FAIpQLSfkmEBqH76HLMMiCC-GPPnhcvHC9aJS86E32dOd0Z8MpY2rvQ/viewform\ndc = connect('harvardartmuseum', _auth={'access_token': api_key})\n\ndf = await dc.query('publication', q='publicationyear:2013', size=5)\ndf[['title','publication date','publication place','format']]\n  ```\n\n|     | title                                             | publication date | publication place | format                   |\n| --- | ------------------------------------------------- | ---------------- | ----------------- | ------------------------ |\n| 0   | 19th Century Paintings, Drawings \u0026 Watercolours   | January 23, 2013 | London            | Auction/Dealer Catalogue |\n| 1   | \"With Éclat\" The Boston Athenæum and the Orig...  | 2013             | Boston, MA        | Book                     |\n| 2   | \"Review: Fragonard's Progress of Love at the F... | 2013             | London            | Article/Essay            |\n| 3   | Alternative Narratives                            | February 2013    | None              | Article/Essay            |\n| 4   | Victorian \u0026 British Impressionist Art             | July 11, 2013    | London            | Auction/Dealer Catalogue |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind 5 galleries that are on floor (Level) 2 in the Harvard Art Museums building.\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”api_key“ by following https://docs.google.com/forms/d/e/1FAIpQLSfkmEBqH76HLMMiCC-GPPnhcvHC9aJS86E32dOd0Z8MpY2rvQ/viewform\ndc = connect('harvardartmuseum', _auth={'access_token': api_key})\n\ndf = await dc.query('gallery', floor=2, size=5)\ndf[['id','name','theme','object count']]\n  ```\n\n|     | id   | name                                         | theme                                             | object count |\n| --- | ---- | -------------------------------------------- | ------------------------------------------------- | ------------ |\n| 0   | 2200 | European and American Art, 17th–19th century | The Emergence of Romanticism in Early Nineteen... | 20           |\n| 1   | 2210 | West Arcade                                  | None                                              | 6            |\n| 2   | 2340 | European and American Art, 17th–19th century | The Silver Cabinet: Art and Ritual, 1600–1850     | 73           |\n| 3   | 2460 | East Arcade                                  | None                                              | 2            |\n| 4   | 2700 | European and American Art, 19th century      | Impressionism and the Late Nineteenth Century     | 19           |\n\n\u003c/details\u003e\n\n\n\n\n\n### Business\n\n#### [Yelp](./api-connectors/yelp) -- Collect Local Business Data\n\u003cdetails\u003e\n  \u003csummary\u003eWhat's the phone number of Capilano Suspension Bridge Park?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”yelp_access_token“ by following https://www.yelp.com/developers/documentation/v3/authentication\nconn_yelp = connect(\"yelp\", _auth={\"access_token\":yelp_access_token}, _concurrency = 5)\n\ndf = await conn_yelp.query(\"businesses\", term = \"Capilano Suspension Bridge Park\", location = \"Vancouver\", _count = 1)\n\ndf[[\"name\",\"phone\"]]\n```\n\n| id  | name                            | phone           |\n| --- | ------------------------------- | --------------- |\n| 0   | Capilano Suspension Bridge Park | +1 604-985-7474 |\n\n  \u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eWhich yoga store has the highest review count in Vancouver?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”yelp_access_token“ by following https://www.yelp.com/developers/documentation/v3/authentication\nconn_yelp = connect(\"yelp\", _auth={\"access_token\":yelp_access_token}, _concurrency = 1)\n\n  # Check all supported categories: https://www.yelp.ca/developers/documentation/v3/all_category_list\ndf = await conn_yelp.query(\"businesses\", categories = \"yoga\", location = \"Vancouver\", sort_by = \"review_count\", _count = 1)\ndf[[\"name\", \"review_count\"]]\n```\n\n| id  | name                | review_count |\n| --- | ------------------- | ------------ |\n| 0   | YYOGA Downtown Flow | 107          |\n\n  \u003c/details\u003e  \n\n\u003cdetails\u003e\n  \u003csummary\u003eHow many Starbucks stores in Seattle and where are they?\u003c/summary\u003e\n\n  ```python\n  from dataprep.connector import connect\n\n  # You can get ”yelp_access_token“ by following https://www.yelp.com/developers/documentation/v3/authentication\n  conn_yelp = connect(\"yelp\", _auth={\"access_token\":yelp_access_token}, _concurrency = 5)\n  df = await conn_yelp.query(\"businesses\", term = \"Starbucks\", location = \"Seattle\", _count = 1000)\n\n  # Remove irrelevant data\n  df = df[(df['city'] == 'Seattle') \u0026 (df['name'] == 'Starbucks')]\n  df[['name', 'address1', 'city', 'state', 'country', 'zip_code']].reset_index(drop=True)\n  ```\n| id  | name      | address1                 | city    | state | country | zip_code |\n| --- | --------- | ------------------------ | ------- | ----- | ------- | -------- |\n| 0   | Starbucks | 515 Westlake Ave N       | Seattle | WA    | US      | 98109    |\n| 1   | Starbucks | 442 Terry Avenue N       | Seattle | WA    | US      | 98109    |\n| ... | .......   | .......                  | ......  | ..    | ..      | ....     |\n| 126 | Starbucks | 17801 International Blvd | Seattle | WA    | US      | 98158    |\n\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the ratings for a list of resturants?\u003c/summary\u003e\n\n  ```python\n  from dataprep.connector import connect\n  import pandas as pd\n  import asyncio\n  # You can get ”yelp_access_token“ by following https://www.yelp.com/developers/documentation/v3/authentication\n  conn_yelp = connect(\"yelp\", _auth={\"access_token\":yelp_access_token}, _concurrency = 5)\n\n  names = [\"Miku\", \"Boulevard\", \"NOTCH 8\", \"Chambar\", \"VIJ’S\", \"Fable\", \"Kirin Restaurant\", \"Cafe Medina\", \\\n   \"Ask for Luigi\", \"Savio Volpe\", \"Nicli Pizzeria\", \"Annalena\", \"Edible Canada\", \"Nuba\", \"The Acorn\", \\\n   \"Lee's Donuts\", \"Le Crocodile\", \"Cioppinos\", \"Six Acres\", \"St. Lawrence\", \"Hokkaido Santouka Ramen\"]\n\n  query_list = [conn_yelp.query(\"businesses\", term=name, location = \"Vancouver\", _count=1) for name in names]\n  results = asyncio.gather(*query_list)\n  df = pd.concat(await results)\n  df[[\"name\", \"rating\", \"city\"]].reset_index(drop=True)\n  ```\n| ID  | Name                           | Rating | City      |\n| --- | ------------------------------ | ------ | --------- |\n| 0   | Miku                           | 4.5    | Vancouver |\n| 1   | Boulevard Kitchen \u0026 Oyster Bar | 4.0    | Vancouver |\n| ... | ...                            | ...    | ...       |\n| 20  | Hokkaido Ramen Santouka        | 4.0    | Vancouver |\n\u003c/details\u003e\n\n#### [Hunter](./api-connectors/hunter) -- Collect and Verify Professional Email Addresses\n\u003cdetails\u003e\n\u003csummary\u003eWho are executives of Asana and what are their emails?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”hunter_access_token“ by registering as a developer https://hunter.io/users/sign_up\nconn_hunter = connect(\"hunter\", _auth={\"access_token\":'hunter_access_token'})\n\ndf = await conn_hunter.query('all_emails', domain='asana.com', _count=10)\n\ndf[df['department']=='executive']\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003efirst_name\u003c/th\u003e\n\u003cth\u003elast_name\u003c/th\u003e\n\u003cth\u003eemail\u003c/th\u003e\n\u003cth\u003eposition\u003c/th\u003e\n\u003cth\u003edepartment\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003eDustin\u003c/td\u003e\n\u003ctd\u003eMoskovitz\u003c/td\u003e\n\u003ctd\u003edustin@asana.com\u003c/td\u003e\n\u003ctd\u003eCofounder\u003c/td\u003e\n\u003ctd\u003eexecutive\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e1\u003c/th\u003e\n\u003ctd\u003eStephanie\u003c/td\u003e\n\u003ctd\u003eHeß\u003c/td\u003e\n\u003ctd\u003eshess@asana.com\u003c/td\u003e\n\u003ctd\u003eCEO\u003c/td\u003e\n\u003ctd\u003eexecutive\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e2\u003c/th\u003e\n\u003ctd\u003eErin\u003c/td\u003e\n\u003ctd\u003eCheng\u003c/td\u003e\n\u003ctd\u003eerincheng@asana.com\u003c/td\u003e\n\u003ctd\u003eStrategic Initiatives\u003c/td\u003e\n\u003ctd\u003eexecutive\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eWhat is Dustin Moskovitz's email?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”hunter_access_token“ by registering as a developer https://hunter.io/users/sign_up\nconn_hunter = connect(\"hunter\", _auth={\"access_token\":'hunter_access_token'})\n\ndf = await conn_hunter.query(\"individual_email\", full_name='dustin moskovitz', domain='asana.com')\n\ndf\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003efirst_name\u003c/th\u003e\n\u003cth\u003elast_name\u003c/th\u003e\n\u003cth\u003eemail\u003c/th\u003e\n\u003cth\u003eposition\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003eDustin\u003c/td\u003e\n\u003ctd\u003eMoskovitz\u003c/td\u003e\n\u003ctd\u003edustin@asana.com\u003c/td\u003e\n\u003ctd\u003eCofounder\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/details\u003e  \n\n\u003cdetails\u003e\n\u003csummary\u003eAre the emails of Asana executives valid?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”hunter_access_token“ by registering as a developer https://hunter.io/users/sign_up\nconn_hunter = connect(\"hunter\", _auth={\"access_token\":'hunter_access_token'})\n\nemployees = await conn_hunter.query(\"all_emails\", domain='asana.com', _count=10)\nexecutives = employees.loc[employees['department']=='executive']\nemails = executives[['email']]\n\nfor email in emails.iterrows():\nstatus = await conn_hunter.query(\"email_verifier\", email=email[1][0])\nemails['status'] = status\n\nemails\n```\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eemail\u003c/th\u003e\n\u003cth\u003estatus\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003edustin@asana.com\u003c/td\u003e\n\u003ctd\u003evalid\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e3\u003c/th\u003e\n\u003ctd\u003eshess@asana.com\u003c/td\u003e\n\u003ctd\u003eNaN\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003ctd\u003eerincheng@asana.com\u003c/td\u003e\n\u003ctd\u003eNaN\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eHow many available requests do I have left?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”hunter_access_token“ by registering as a developer https://hunter.io/users/sign_up\nconn_hunter = connect(\"hunter\", _auth={\"access_token\":'hunter_access_token'})\n\ndf = await conn_hunter.query(\"account\")\ndf\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003erequests available\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003e19475\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat are the counts of each level of seniority of Intercom employees?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”hunter_access_token“ by registering as a developer https://hunter.io/users/sign_up\nconn_hunter = connect(\"hunter\", _auth={\"access_token\":'hunter_access_token'})\n\ndf = await conn_hunter.query(\"email_count\", domain='intercom.io')\ndf.drop('total', axis=1)\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003ejunior\u003c/th\u003e\n\u003cth\u003esenior\u003c/th\u003e\n\u003cth\u003eexecutive\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e2\u003c/td\u003e\n\u003ctd\u003e2\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/details\u003e\n\n### Calendar\n\n#### [Holiday](./api-connectors/holiday) -- Collect Holiday, Workday Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the supported countries, their country codes and languages supported?\u003c/summary\u003e\n\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”holiday_key“ by following https://holidayapi.com/docs\ndc = connect('holiday', _auth={'access_token': holiday_key})\n\ndf = await dc.query(\"country\")\ndf\n```\n\n|     | code | name                 | languages |\n| --- | ---- | -------------------- | --------- |\n| 0   | AD   | Andorra              | ['ca'     |\n| 1   | AE   | United Arab Emirates | ['ar']    |\n| ..  | ..   | ...                  | ...       |\n| 249 | ZW   | Zimbabwe             | ['en']    |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the public holidays of Canada in 2020?\u003c/summary\u003e\n\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”holiday_key“ by following https://holidayapi.com/docs\ndc = connect('holiday', _auth={'access_token': holiday_key})\n\ndf = await dc.query('holiday', country='CA', year=2020, public=True)\ndf\n```\n\n|     | name           | date       | public | observed   | weekday   |\n| --- | -------------- | ---------- | ------ | ---------- | --------- |\n| 0   | New Year's Day | 2020-01-01 | True   | 2020-01-01 | Wednesday |\n| 1   | Good Friday    | 2020-04-10 | True   | 2020-04-10 | Friday    |\n| 2   | Victoria Day   | 2020-05-18 | True   | 2020-05-18 | Monday    |\n| 3   | Canada Day     | 2020-07-01 | True   | 2020-07-01 | Wednesday |\n| 4   | Labor Day      | 2020-09-07 | True   | 2020-09-07 | Monday    |\n| 5   | Christmas Day  | 2020-12-25 | True   | 2020-12-25 | Friday    |\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich day is the 100th workday starting from 2020-01-01, in Canada?\u003c/summary\u003e\n\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”holiday_key“ by following https://holidayapi.com/docs\ndc = connect('holiday', _auth={'access_token': holiday_key})\n\ndf = await dc.query('workday', country='CA', start='2020-01-01', days=100)\ndf\n```\n\n|     | date      | weekday |\n| --- | --------- | ------- |\n| 0   | 2020-5-22 | Friday  |\n\n\u003c/details\u003e\n\n### Crime\n\n#### [JailBase](./api-connectors/jailbase) -- Collect Prisoner Data\n\u003cdetails\u003e\n\u003csummary\u003eWhat is the URL for the mugshot of Almondo Smith?\u003c/summary\u003e\n\n```python\n# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase\ndc = connect('jailbase', _auth={'access_token':jailbase_access_token})\n\ndf = await dc.query('search', source_id='wi-wcsd', last_name='smith', first_name='almondo')\n\ndf['mugshot'][0]\n```\n\n\n\n\n'https://imgstore.jailbase.com/small/arrested/wi-wcsd/2017-12-29/almondo-smith-679063bf90e389938d70b0b49caf7944.pic1.jpg'\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eWho were the 10 most recently arrested people by Wood County Sheriff's Department?\u003c/summary\u003e\n\n```python\n# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase\ndc = connect('jailbase', _auth={'access_token':jailbase_access_token})\nsources = await dc.query('sources')\ndepartment = sources[sources['name']=='Wood County Sheriff\\'s Dept']\n\ndf = await dc.query('recent', source_id=department['source_id'].values[0])\n\ndf\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eid\u003c/th\u003e\n\u003cth\u003ename\u003c/th\u003e\n\u003cth\u003emugshot\u003c/th\u003e\n\u003cth\u003echarges\u003c/th\u003e\n\u003cth\u003emore_info_url\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003e23917656\u003c/td\u003e\n\u003ctd\u003eCurtis Joseph\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdcurtis-josep...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e1\u003c/th\u003e\n\u003ctd\u003e23917654\u003c/td\u003e\n\u003ctd\u003eTaner Summers\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdtaner-summer...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e2\u003c/th\u003e\n\u003ctd\u003e23901411\u003c/td\u003e\n\u003ctd\u003eMaryann Randolph\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdmaryann-rand...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e3\u003c/th\u003e\n\u003ctd\u003e23821284\u003c/td\u003e\n\u003ctd\u003eAntonia Cinodijay\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/widgets/NoMug.gif\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdantonia-cino...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003ctd\u003e23821280\u003c/td\u003e\n\u003ctd\u003eDeangelo Barker\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsddeangelo-bar...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e5\u003c/th\u003e\n\u003ctd\u003e23811811\u003c/td\u003e\n\u003ctd\u003eTekeisha Faucibus\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdtekeisha-fau...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e6\u003c/th\u003e\n\u003ctd\u003e23811810\u003c/td\u003e\n\u003ctd\u003eTariq Nunoke\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdtariq-nunoke...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e7\u003c/th\u003e\n\u003ctd\u003e23811808\u003c/td\u003e\n\u003ctd\u003eSarah Jusakaja\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdsarah-jusaka...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e8\u003c/th\u003e\n\u003ctd\u003e23791805\u003c/td\u003e\n\u003ctd\u003eAngela Burch\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdangela-burch...\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e9\u003c/th\u003e\n\u003ctd\u003e23775367\u003c/td\u003e\n\u003ctd\u003eSuzanne Nicholson\u003c/td\u003e\n\u003ctd\u003ehttps://imgstore.jailbase.com/small/arrested/w...\u003c/td\u003e\n\u003ctd\u003e[[]]\u003c/td\u003e\n\u003ctd\u003ehttp://www.jailbase.com/en/wi-wcsdsuzanne-nich...\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eHow many police offices are in each US state in the JailBase system?\u003c/summary\u003e\n\n```python\n# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase\ndc = connect('jailbase', _auth={'access_token':jailbase_access_token})\n\ndf = await dc.query('sources')\n\nstate_counts = df['state'].value_counts()\nstate_counts\n```\n\n\n\n\n    North Carolina    81\n    Kentucky          75\n    Missouri          73\n    Arkansas          70\n    Iowa              67\n    Texas             57\n    Virginia          47\n    Florida           46\n    Mississippi       44\n    Indiana           38\n    New York          37\n    South Carolina    35\n    Ohio              29\n    Colorado          27\n    Tennessee         26\n    Alabama           26\n    Idaho             23\n    New Mexico        18\n    California        18\n    Michigan          17\n    Georgia           17\n    Illinois          14\n    Washington        13\n    Wisconsin         11\n    Oregon            10\n    Nevada             9\n    Arizona            9\n    Louisiana          8\n    New Jersey         7\n    Oklahoma           6\n    Utah               5\n    Minnesota          5\n    Pennsylvania       4\n    Maryland           4\n    Kansas             3\n    North Dakota       3\n    South Dakota       2\n    Wyoming            2\n    Alaska             1\n    West Virginia      1\n    Nebraska           1\n    Montana            1\n    Connecticut        1\n    Name: state, dtype: int64\n\n\n\u003c/details\u003e\n\n\n### Finance\n\n#### [Finnhub](./api-connectors/finnhub) -- Collect Financial, Market, Economic Data\n\u003cdetails\u003e\n  \u003csummary\u003eHow to get a list of cryptocurrencies and their exchanges\u003c/summary\u003e\n\n```python\nimport pandas as pd\nfrom dataprep.connector import connect\n\n# You can get ”finnhub_access_token“ by following https://finnhub.io/\nconn_finnhub = connect(\"finnhub\", _auth={\"access_token\":finnhub_access_token}, update=True)\n\ndf = await conn_finnhub.query('crypto_exchange')\nexchanges = df['exchange'].to_list()\nsymbols = []\nfor ex in exchanges:\n    data = await df.query('crypto_symbols', exchange=ex)\n    symbols.append(data)\ndf_symbols = pd.concat(symbols)\ndf_symbols\n```\n\n| id  | description       | displaySymbol | symbol            |\n| --- | ----------------- | ------------- | ----------------- |\n| 0   | Binance FRONT/ETH | FRONT/ETH     | BINANCE:FRONTETH  |\n| 1   | Binance ATOM/BUSD | ATOM/BUSD     | BINANCE:ATOMBUSD  |\n| ... | ...               | ...           | ...               |\n| 281 | Poloniex AKRO/BTC | AKRO/BTC      | POLONIEX:BTC_AKRO |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich ipo in the current month has the highest total share values?\u003c/summary\u003e\n\n```python\nimport calendar\nfrom datetime import datetime\nfrom dataprep.connector import connect\n\n# You can get ”finnhub_access_token“ by following https://finnhub.io/\nconn_finnhub = connect(\"finnhub\", _auth={\"access_token\":finnhub_access_token}, update=True)\n\ntoday = datetime.today()\ndays_in_month = calendar.monthrange(today.year, today.month)[1]\ndate_from = today.replace(day=1).strftime('%Y-%m-%d')\ndate_to = today.replace(day=days_in_month).strftime('%Y-%m-%d')\nipo_df = await conn_finnhub.query('ipo_calender', from_=date_from, to=date_to)\nipo_df[ipo_df['totalSharesValue'] == ipo_df['totalSharesValue'].max()]\n```\n| id  | date       | exchange | name                           | numberOfShares | ... | totalSharesValue |\n| --- | ---------- | -------- | ------------------------------ | -------------- | --- | ---------------- |\n| 5   | 2021-02-03 | NYSE     | TELUS International (Cda) Inc. | 33333333       | ... | 9.58333e+08      |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the average acutal earnings from the last 4 seasons of a list of 10 popular stocks?\u003c/summary\u003e\n\n```python\nimport asyncio\nimport pandas as pd\nfrom dataprep.connector import connect\n\n# You can get ”finnhub_access_token“ by following https://finnhub.io/\nconn_finnhub = connect(\"finnhub\", _auth={\"access_token\":finnhub_access_token}, update=True)\n\nstock_list = ['TSLA', 'AAPL', 'WMT', 'GOOGL', 'FB', 'MSFT', 'COST', 'NVDA', 'JPM', 'AMZN']\nquery_list = [conn_finnhub.query('earnings', symbol=symbol) for symbol in stock_list]\nquery_results = asyncio.gather(*query_list)\nstocks_df = pd.concat(await query_results)\nstocks_df = stocks_df.groupby('symbol', as_index=False).agg({'actual': ['mean']})\nstocks_df.columns = stocks_df.columns.get_level_values(0)\nstocks_df = stocks_df.sort_values(by='actual', ascending=False).rename(columns={'actual': 'avg_actual'})\nstocks_df.reset_index(drop=True)\n```\n\n| id  | symbol | avg_actual |\n| --- | ------ | ---------- |\n| 0   | GOOGL  | 12.9375    |\n| 1   | AMZN   | 8.5375     |\n| 2   | FB     | 2.4475     |\n| ..  | ...    | ...        |\n| 9   | TSLA   | 0.556      |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the earnings of last 4 quarters of a given company? (e.g. TSLA)\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nfrom datetime import datetime, timedelta, timezone\n\n# You can get ”finnhub_access_token“ by following https://finnhub.io/\nconn_finnhub = connect(\"finnhub\", _auth={\"access_token\":finnhub_access_token}, update=True)\n\ntoday = datetime.now(tz=timezone.utc)\noneyear = today - timedelta(days = 365)\nstart = int(round(oneyear.timestamp()))\n\nresult = await conn_finnhub.query('earnings_calender', symbol='TSLA', from_=start, to=today)\nresult = result.set_index('date')\nresult\n```\n| id   | date       | epsActual | epsEstimate | hour | quarter | ... | symbol | year |\n| :--- | :--------- | --------: | ----------: | :--- | ------: | --- | :----- | ---: |\n| 0    | 2021-01-27 |       0.8 |     1.37675 | amc  |       4 | ... | TSLA   | 2020 |\n| 1    | 2020-10-21 |      0.76 |    0.600301 | amc  |       3 | ... | TSLA   | 2020 |\n| 2    | 2020-07-22 |     0.436 |  -0.0267036 | amc  |       2 | ... | TSLA   | 2020 |\n| ..   | ...        |       ... |         ... | ...  |     ... | ... | ...    |  ... |\n| 3    | 2011-02-15 |    -0.094 |   -0.101592 | amc  |       4 | ... | TSLA   | 2010 |\n\n\u003c/details\u003e\n\n#### [CoinGecko](./api-connectors/coingecko) -- Collect Cryptocurrency Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the 10 cryptocurrencies with highest market cap and their current information?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_coingecko = connect(\"coingecko\")\ndf = await conn_coingecko.query('markets', vs_currency='usd', order='market_cap_desc', per_page=10, page=1)\ndf\n```\n|      | name         | symbol | current_price |  market_cap | market_cap_rank | high_24h | low_24h | price_change_24h | price_change_percentage_24h | market_cap_change_24h | market_cap_change_percentage_24h | last_updated             |\n| ---: | :----------- | :----- | ------------: | ----------: | --------------: | -------: | ------: | ---------------: | --------------------------: | --------------------: | -------------------------------: | :----------------------- |\n|    0 | Bitcoin      | btc    |         36811 | 6.86613e+11 |               1 |    37153 |   35344 |          1440.68 |                      4.0731 |           3.10933e+10 |                           4.7433 | 2021-02-03T19:24:09.271Z |\n|    1 | Ethereum     | eth    |       1628.99 | 1.87035e+11 |               2 |  1645.73 | 1486.42 |           132.91 |                     8.88404 |           1.64296e+10 |                          9.63018 | 2021-02-03T19:22:32.413Z |\n|   .. | ...          | ...    |           ... |         ... |             ... |      ... |     ... |              ... |                         ... |                   ... |                              ... | ...                      |\n|    9 | Binance Coin | bnb    |         51.47 | 7.60256e+09 |              10 |    51.63 |   49.76 |             1.24 |                     2.47631 |           1.64863e+08 |                          2.21659 | 2021-02-03T19:25:45.456Z |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the cryptocurrencies with highest increasing and decreasing percentage?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_coingecko = connect(\"coingecko\")\ndf = await conn_coingecko.query('markets', vs_currency='usd', per_page=1000, page=1)\ndf = df.sort_values(by=['price_change_percentage_24h']).reset_index(drop=True).dropna()\nprint(\"Coin with highest decreasing percetage: {}, which decreases {}%\".format(df['name'].iloc[0], df['price_change_percentage_24h'].iloc[0]))\nprint(\"Coin with highest increasing percetage: {}, which increases {}%\".format(df['name'].iloc[-1], df['price_change_percentage_24h'].iloc[-1]))\n```\nCoin with the highest decreasing percentage: `PancakeSwap`, which decreases `-13.79622%`\n\nCoin with the highest increasing percentage: `StormX`, which increases `101.24182%`\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich cryptocurrencies are trending in CoinGecko?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_coingecko = connect(\"coingecko\")\ndf = await conn_coingecko.query('trend')\ndf\n```\n|      | id                | name        | symbol | market_cap_rank | score |\n| ---: | :---------------- | :---------- | :----- | --------------: | ----: |\n|    0 | bao-finance       | Bao Finance | BAO    |             175 |     0 |\n|    1 | milk2             | MILK2       | MILK2  |             634 |     1 |\n|    2 | unitrade          | Unitrade    | TRADE  |             529 |     2 |\n|    3 | pancakeswap-token | PancakeSwap | CAKE   |             110 |     3 |\n|    4 | fsw-token         | Falconswap  | FSW    |             564 |     4 |\n|    5 | zeroswap          | ZeroSwap    | ZEE    |             550 |     5 |\n|    6 | storm             | StormX      | STMX   |             211 |     6 |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the 10 US exchanges with highest trade volume in the past 24 hours?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_coingecko = connect(\"coingecko\")\ndf = await conn_coingecko.query('exchanges')\nresult = df[df['country']=='United States'].reset_index(drop=True).head(10)\nresult\n```\n|      | id         | name         | year_established | ...  | trade_volume_24h_btc_normalized |\n| ---: | :--------- | :----------- | ---------------: | :--- | ------------------------------: |\n|    0 | gdax       | Coinbase Pro |             2012 | ...  |                         90085.6 |\n|    1 | kraken     | Kraken       |             2011 | ...  |                         48633.1 |\n|    2 | binance_us | Binance US   |             2019 | ...  |                         7380.83 |\n|   .. | ...        | ...          |              ... | ...  |                             ... |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the 3 latest traded derivatives with perpetual contract?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport pandas as pd\n\nconn_coingecko = connect(\"coingecko\")\ndf = await conn_coingecko.query('derivatives')\nperpetual_df = df[df['contract_type'] == 'perpetual'].reset_index(drop=True)\nperpetual_df['last_traded_at'] = pd.to_datetime(perpetual_df['last_traded_at'], unit='s')\nperpetual_df.sort_values(by=['last_traded_at'], ascending=False).head(3).reset_index(drop=True)\n```\n|      | market         | symbol     | index_id | contract_type |     index |     basis | funding_rate | open_interest |  volume_24h | last_traded_at      |\n| ---: | :------------- | :--------- | :------- | :------------ | --------: | --------: | -----------: | ------------: | ----------: | :------------------ |\n|    0 | Huobi Futures  | MATIC-USDT | MATIC    | perpetual     | 0.0433357 | -0.606296 |     0.247604 |           nan | 1.43338e+06 | 2021-02-03 20:14:24 |\n|    1 | Biki (Futures) | 1          | BTC      | perpetual     |   36769.8 | -0.153111 |      -0.0519 |           nan | 1.00131e+08 | 2021-02-03 20:14:23 |\n|    2 | Huobi Futures  | CVC-USDT   | CVC      | perpetual     |  0.178268 | -0.336302 |     0.106314 |           nan |      876960 | 2021-02-03 20:14:23 |\n\u003c/details\u003e\n\n### Geocoding\n\n#### [MapQuest](./api-connectors/mapquest) -- Collect Driving Directions, Maps, Traffic Data\n\u003cdetails\u003e\n  \u003csummary\u003eWhere is the Simon Fraser University? Give all the places if there is more than one campus.\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\n\nBC_BBOX = \"-139.06,48.30,-114.03,60.00\"\ncampus = await conn_map.query(\"place\", q = \"Simon Fraser University\", sort = \"relevance\", bbox = BC_BBOX, _count = 50)\ncampus = campus[campus[\"name\"] == \"Simon Fraser University\"].reset_index()\n```\n\n|   id | index | name                    | country | state | city      | address                 | postalCode | coordinates              | details |\n| ---: | ----: | :---------------------- | :------ | :---- | :-------- | :---------------------- | :--------- | :----------------------- | :------ |\n|    0 |     0 | Simon Fraser University | CA      | BC    | Burnaby   | 8888 University Drive E | V5A 1S6    | [-122.90416, 49.27647]   | ...     |\n|    1 |     2 | Simon Fraser University | CA      | BC    | Vancouver | 602 Hastings St W       | V6B 1P2    | [-123.113431, 49.284626] | ...     |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow many KFC are there in Burnaby? What are their address?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\n\nBC_BBOX = \"-139.06,48.30,-114.03,60.00\"\nkfc = await conn_map.query(\"place\", q = \"KFC\", sort = \"relevance\", bbox = BC_BBOX, _count = 500)\nkfc = kfc[(kfc[\"name\"] == \"KFC\") \u0026 (kfc[\"city\"] == \"Burnaby\")].reset_index()\nprint(\"There are %d KFCs in Burnaby\" % len(kfc))\nprint(\"Their addresses are:\")\nkfc['address']\n```\nThere are 1 KFCs in Burnaby\n\nTheir addresses are:\n\n|   id |       address |\n| ---: | ------------: |\n|    0 | 5094 Kingsway |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eThe ratio of Starbucks to Tim Hortons in Vancouver?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\nVAN_BBOX = '-123.27,49.195,-123.020,49.315'\nstarbucks = await conn_map.query('place', q='starbucks', sort='relevance', bbox=VAN_BBOX, page='1', pageSize = '50', _count=200)\ntimmys = await conn_map.query('place', q='Tim Hortons', sort='relevance', bbox=VAN_BBOX, page='1', pageSize = '50', _count=200)\n\nis_vancouver_sb = starbucks['city'] == 'Vancouver'\nis_vancouver_tim = timmys['city'] == 'Vancouver'\nsb_in_van = starbucks[is_vancouver_sb]\ntim_in_van = timmys[is_vancouver_tim]\nprint('The ratio of Starbucks:Tim Hortons in Vancouver is %d:%d' % (len(sb_in_van), len(tim_in_van)))\n```\n\nThe ratio of Starbucks:Tim Hortons in Vancouver is 188:120\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the closest gas station from Metropolist and how far is it?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nfrom numpy import radians, sin, cos, arctan2, sqrt\n\ndef distance_in_km(cord1, cord2):\n    R = 6373.0\n\n    lat1 = radians(cord1[1])\n    lon1 = radians(cord1[0])\n    lat2 = radians(cord2[1])\n    lon2 = radians(cord2[0])\n\n    dlon = lon2 - lon1\n    dlat = lat2 - lat1\n\n    a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2\n    c = 2 * arctan2(sqrt(a), sqrt(1 - a))\n    distance = R * c\n\n    return(distance)\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\nMETRO_TOWN = [-122.9987, 49.2250]\nMETRO_TOWN_string = '%f,%f' % (METRO_TOWN[0], METRO_TOWN[1])\nnearest_petro = await conn_map.query('place', q='gas station', sort='distance', location=METRO_TOWN_string, page='1', pageSize = '1')\nprint('Metropolist is %fkm from the nearest gas station' % distance_in_km(METRO_TOWN, nearest_petro['coordinates'][0]))\nprint('The gas station is %s at %s' % (nearest_petro['name'][0], nearest_petro['address'][0]))\n```\nMetropolist is 0.376580km from the nearest gas station\n\nThe gas station is Chevron at 4692 Imperial St\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eIn BC, which city has the most amount of shopping centers?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\nBC_BBOX = \"-139.06,48.30,-114.03,60.00\"\nGROCERY = 'sic:541105'\nshop_list = await conn_map.query(\"place\", sort=\"relevance\", bbox=BC_BBOX, category=GROCERY, _count=500)\nshop_list = shop_list[shop_list[\"state\"] == \"BC\"]\nshop_list.groupby('city')['name'].count().sort_values(ascending=False).head(10)\n```\n\n|            city | count |\n| --------------: | ----: |\n|       Vancouver |    42 |\n|        Victoria |    24 |\n|          Surrey |    15 |\n|         Burnaby |    14 |\n|             ... |   ... |\n| North Vancouver |     8 |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhere is the nearest grocery of SFU? How many miles far? And how much time estimated for driving?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”mapquest_access_token“ by following https://developer.mapquest.com/\nconn_map = connect(\"mapquest\", _auth={\"access_token\": mapquest_access_token}, _concurrency = 10)\nSFU_LOC = '-122.90416, 49.27647'\nGROCERY = 'sic:541105'\nnearest_grocery = await conn_map.query(\"place\", location=SFU_LOC, sort=\"distance\", category=GROCERY)\ndestination = nearest_grocery.iloc[0]['details']\nname = nearest_grocery.iloc[0]['name']\nroute = await conn_map.query(\"route\", from_='8888 University Drive E, Burnaby', to=destination)\ntotal_distance = sum([float(i)for i in route.iloc[:]['distance']])\ntotal_time = sum([int(i)for i in route.iloc[:]['time']])\nprint('The nearest grocery of SFU is ' + name + '. It is ' + str(total_distance) + ' miles far, and It is expected to take ' + str(total_time // 60) + 'm' + str(total_time % 60)+'s of driving.')\nroute\n```\nThe nearest grocery of SFU is Nesters Market. It is 1.234 miles far, and It is expected to take 3m21s of driving.\n\n|   id | index | narrative                                                            | distance | time |\n| ---: | ----: | :------------------------------------------------------------------- | -------: | ---: |\n|    0 |     0 | Start out going east on University Dr toward Arts Rd.                |    0.348 |   57 |\n|    1 |     1 | Turn left to stay on University Dr.                                  |    0.606 |   84 |\n|    2 |     2 | Enter next roundabout and take the 1st exit onto University High St. |     0.28 |   60 |\n|    3 |     3 | 9000 UNIVERSITY HIGH STREET is on the left.                          |        0 |    0 |\n\n\u003c/details\u003e\n\n### Jobs\n\n#### [The Muse](./api-connectors/themuse) -- Collect Job Ads, Company Information\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the data science jobs in Vancouver on the fisrt page?\u003c/summary\u003e\n\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”app_key“ by following https://www.themuse.com/developers/api/v2/apps\ndc = connect('themuse', _auth={'access_token': app_key})\n\ndf = await dc.query('jobs', page=1, category='Data Science', location='Vancouver, Canada')\ndf[['id', 'name', 'company', 'locations', 'levels', 'publication_date']]\n  ```\n\n|     | id      | name                                   | company           | locations                                         | levels                                            | publication_date            |\n| --- | ------- | -------------------------------------- | ----------------- | ------------------------------------------------- | ------------------------------------------------- | --------------------------- |\n| 0   | 5126286 | Senior Data Scientist                  | Discord           | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Senior Level', 'short_name': 'senio... | 2021-03-15T11:10:24Z        |\n| 1   | 5543215 | Data Scientist-AI/ML (Remote)          | Dell Technologies | [{'name': 'Chicago, IL'}, {'name': 'Flexible /... | [{'name': 'Mid Level', 'short_name': 'mid'}]      | 2021-04-02T11:45:57Z        |\n| 2   | 4959228 | Senior Data Scientist                  | Humana            | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Senior Level', 'short_name': 'senio... | 2021-01-05T11:28:23.814281Z |\n| 3   | 5172631 | Data Scientist - Marketing             | Stash             | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Mid Level', 'short_name': 'mid'}]      | 2021-03-26T23:09:33Z        |\n| 4   | 5372353 | Data Science Intern, Machine Learning  | Coursera          | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Internship', 'short_name': 'interns... | 2021-04-05T23:04:40Z        |\n| 5   | 5298606 | Senior Machine Learning Engineer       | Affirm            | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Senior Level', 'short_name': 'senio... | 2021-03-17T23:10:51Z        |\n| 6   | 5166882 | Data Scientist                         | Postmates         | [{'name': 'Bellevue, WA'}, {'name': 'Los Angel... | [{'name': 'Mid Level', 'short_name': 'mid'}]      | 2021-02-01T17:49:53.238832Z |\n| 7   | 5375212 | Director, Data Science \u0026 Analytics     | UKG               | [{'name': 'Flexible / Remote'}, {'name': 'Lowe... | [{'name': 'management', 'short_name': 'managem... | 2021-03-31T23:17:53Z        |\n| 8   | 5130731 | Senior Data Scientist                  | Humana            | [{'name': 'Flexible / Remote'}]                   | [{'name': 'Senior Level', 'short_name': 'senio... | 2021-01-26T11:42:44.232111Z |\n| 9   | 5306269 | Director of Data Sourcing and Strategy | Opendoor          | [{'name': 'Flexible / Remote'}]                   | [{'name': 'management', 'short_name': 'managem... | 2021-03-31T23:05:22Z        |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the senior-level data science positions at Amazon on the first page?\u003c/summary\u003e\n\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”app_key“ by following https://www.themuse.com/developers/api/v2/apps\ndc = connect('themuse', _auth={'access_token': app_key})\n\ndf = await dc.query('jobs', page=1, category='Data Science', company='Amazon', level='Senior Level')\ndf[:10][['id', 'name', 'company', 'locations', 'publication_date']]\n  ```\n\n|     | id      | name                                              | company | locations                            | publication_date            |\n| --- | ------- | ------------------------------------------------- | ------- | ------------------------------------ | --------------------------- |\n| 0   | 5153796 | Sr. Data Architect, Data Lake \u0026 Analytics - Na... | Amazon  | [{'name': 'San Diego, CA'}]          | 2021-02-01T22:54:14.002653Z |\n| 1   | 4083477 | Principal Data Architect, Data Lake \u0026 Analytics   | Amazon  | [{'name': 'Chicago, IL'}]            | 2021-02-01T23:14:17.251814Z |\n| 2   | 4149878 | Principal Data Architect, Data Warehousing \u0026 MPP  | Amazon  | [{'name': 'Arlington, VA'}]          | 2021-02-01T23:15:22.017573Z |\n| 3   | 4497753 | Data Architect - Data Lake \u0026 Analytics - Natio... | Amazon  | [{'name': 'Irvine, CA'}]             | 2021-02-01T23:15:22.439949Z |\n| 4   | 4870271 | Data Scientist                                    | Amazon  | [{'name': 'Seattle, WA'}]            | 2021-02-01T23:04:25.967878Z |\n| 5   | 4603482 | Data Scientist - Prime Gaming                     | Amazon  | [{'name': 'Seattle, WA'}]            | 2021-02-01T23:10:37.628292Z |\n| 6   | 5193240 | Data Scientist                                    | Amazon  | [{'name': 'Seattle, WA'}]            | 2021-02-04T23:56:19.176327Z |\n| 7   | 4678426 | Sr Data Architect - Streaming                     | Amazon  | [{'name': 'Roseville, CA'}]          | 2021-02-01T22:51:25.598645Z |\n| 8   | 4150011 | Data Architect - Data Lake \u0026 Analytics - Natio... | Amazon  | [{'name': 'Tampa, FL'}]              | 2021-02-04T23:56:18.281215Z |\n| 9   | 4346719 | Sr. Data Scientist - ML Labs                      | Amazon  | [{'name': 'London, United Kingdom'}] | 2021-02-01T23:12:42.038111Z |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the top 10 companies in engineering? (sorted by factors such as trendiness, uniqueness, newness, etc)?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\n# You can get ”app_key“ by following https://www.themuse.com/developers/api/v2/apps\ndc = connect('themuse', _auth={'access_token': app_key})\n\ndf = await dc.query('companies', industry='Engineering', page=1)\ndf[:10]\n  ```\n\n|     | id    | name                 | locations                                         | size        | publication_date            | url                                               |\n| --- | ----- | -------------------- | ------------------------------------------------- | ----------- | --------------------------- | ------------------------------------------------- |\n| 0   | 706   | Appian               | [{'name': 'Tysons Corner, VA'}]                   | Medium Size | 2015-11-25T18:17:50.926146Z | https://www.themuse.com/companies/appian          |\n| 1   | 12168 | Bristol Myers Squibb | [{'name': 'Boudry, Switzerland'}, {'name': 'De... | Large Size  | 2020-12-15T15:55:56.940074Z | https://www.themuse.com/companies/bristolmyers... |\n| 2   | 11897 | McMaster-Carr        | [{'name': 'Atlanta, GA'}, {'name': 'Chicago, I... | Large Size  | 2020-02-10T21:57:15.338561Z | https://www.themuse.com/companies/mcmastercarr    |\n| 3   | 12162 | ServiceNow           | [{'name': 'Santa Clara, CA'}]                     | Large Size  | 2021-01-26T23:48:13.066632Z | https://www.themuse.com/companies/servicenow      |\n| 4   | 11731 | Tenaska              | [{'name': 'Boston, MA'}, {'name': 'Dallas, TX'... | Large Size  | 2019-03-14T14:01:54.465873Z | https://www.themuse.com/companies/tenaska         |\n| 5   | 11885 | Brex                 | [{'name': 'Flexible / Remote'}, {'name': 'New ... | Medium Size | 2020-02-05T23:16:44.780028Z | https://www.themuse.com/companies/brex            |\n| 6   | 1483  | Inline Plastics      | [{'name': 'Shelton, CT'}]                         | Medium Size | 2017-09-11T14:49:24.153633Z | https://www.themuse.com/companies/inlineplastics  |\n| 7   | 12113 | Dematic              | [{'name': 'Atlanta, GA'}, {'name': 'Banbury, U... | Large Size  | 2020-09-17T20:29:19.400892Z | https://www.themuse.com/companies/dematic         |\n| 8   | 11967 | Kairos Power         | [{'name': 'Albuquerque, NM'}, {'name': 'Charlo... | Medium Size | 2020-12-07T21:29:33.538815Z | https://www.themuse.com/companies/kairospower     |\n| 9   | 11913 | Siemens              | [{'name': 'Munich, Germany'}]                     | Large Size  | 2020-01-23T21:35:56.937727Z | https://www.themuse.com/companies/siemens         |\n\n\u003c/details\u003e\n\n### Lifestyle\n\n#### [Spoonacular](./api-connectors/spoonacular) -- Collect Recipe, Food, and Nutritional Information Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich foods are unhealthy, i.e.,have high carbs and high fat content?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\nimport pandas as pd\n\ndc = connect('spoonacular', _auth={'access_token': API_key}, concurrency=3, update=True)\n\ndf = await dc.query('recipes_by_nutrients', minFat=65, maxFat=100, minCarbs=75, maxCarbs=100, _count=20)\n\ndf[\"calories\"] = pd.to_numeric(df[\"calories\"]) # convert string type to numeric\ndf = df[df['calories']\u003e1100] # considering foods with more than 1100 calories per serving to be unhealthy\n\ndf[[\"title\",\"calories\",\"fat\",\"carbs\"]].sort_values(by=['calories'], ascending=False)\n  ```\n\n| id  | title                             | calories | fat | carbs |\n| --- | --------------------------------- | -------- | --- | ----- |\n| 2   | Brownie Chocolate Chip Cheesecake | 1210     | 92g | 79g   |\n| 8   | Potato-Cheese Pie                 | 1208     | 80g | 96g   |\n| 0   | Stuffed Shells with Beef and Broc | 1192     | 72g | 81g   |\n| 3   | Coconut Crusted Rockfish          | 1187     | 72g | 92g   |\n| 4   | Grilled Ratatouille               | 1143     | 82g | 88g   |\n| 7   | Pecan Bars                        | 1121     | 84g | 91g   |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich meat dishes are rich in proteins?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\ndc = connect('spoonacular', _auth={'access_token': API_key}, concurrency=3, update=True)\n\ndf = await dc.query('recipes', query='beef', diet='keto', minProtein=25, maxProtein=60, _count=5)\ndf = df[[\"title\",\"nutrients\"]]\n\n# Output of 'nutrients' column : [{'title': 'Protein', 'amount': 22.3768, 'unit': 'g'}]\ng = [] # to extract the exact amount of Proteins in grams and store as list\nfor i in df[\"nutrients\"]:\n    z = i[0]\n    g.append(z['amount'])\n    \ndf.insert(1,'Protein(g)',g)\ndf[[\"title\",\"Protein(g)\"]].sort_values(by='Protein(g)',ascending=False)\n  ```\n\n| id  | title                                             | Protein(g) |\n| --- | ------------------------------------------------- | ---------- |\n| 3   | Strip steak with roasted cherry tomatoes and v... | 56.2915    |\n| 0   | Low Carb Brunch Burger                            | 53.7958    |\n| 2   | Entrecote Steak with Asparagus                    | 41.6676    |\n| 1   | Italian Style Meatballs                           | 35.9293    |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhich Italian Vegan dishes are popular?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\n\ndc = connect('spoonacular', _auth={'access_token': API_key}, concurrency=3, update=True)\n\ndf = await dc.query('recipes', query='popular veg dishes', cuisine='italian', diet='vegan', _count=20)\ndf[[\"title\"]]\n  ```\n\n| id  | Title                                             |\n| --- | ------------------------------------------------- |\n| 0   | Vegan Pea and Mint Pesto Bruschetta               |\n| 1   | Gluten Free Vegan Gnocchi                         |\n| 2   | Fresh Tomato Risotto with Grilled Green Vegeta... |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the top 5 liked chicken recipes with common ingredients?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\nimport pandas as pd\n\ndc = connect('spoonacular', _auth={'access_token': API_key}, concurrency=3, update=True)\n\ndf= await dc.query('recipes_by_ingredients', ingredients='chicken,buttermilk,salt,pepper')\ndf['likes'] = pd.to_numeric(df['likes'])\n\ndf[['title', 'likes']].sort_values(by=['likes'], ascending=False).head(5)\n  ```\n\n| id  | title                                             | likes |\n| --- | ------------------------------------------------- | ----- |\n| 9   | Oven-Fried Ranch Chicken                          | 561   |\n| 1   | Fried Chicken and Wild Rice Waffles with Pink ... | 78    |\n| 6   | CCC: Carla Hall’s Fried Chicken                   | 47    |\n| 2   | Buttermilk Fried Chicken                          | 12    |\n| 0   | My Pantry Shelf                                   | 10    |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the average calories for high calorie Korean foods?\u003c/summary\u003e\n\n  ```python\nfrom dataprep.connector import connect\nfrom statistics import mean \n\ndc = connect('spoonacular', _auth={'access_token': API_key}, concurrency=3, update=True)\n\ndf = await dc.query('recipes', query='korean', minCalories = 500)\nnutri = df['nutrients'].tolist()\n\ncalories = []\nfor i in range(len(nutri)):\n    calories.append(nutri[i][0]['amount'])\n\nprint('Average calories for high calorie Korean foods:', mean(calories),'kcal')\n  ```\n\nAverage calories for high calorie Korean foods: 644.765 kcal\n\n\u003c/details\u003e\n\n\n\n\n### Music\n\n#### [MusixMatch](./api-connectors/musicmatch) -- Collect Music Lyrics Data\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is Katy Perry's Twitter URL?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\ndf = await conn_musixmatch.query(\"artist_info\", artist_mbid = \"122d63fc-8671-43e4-9752-34e846d62a9c\")\n\ndf[['name', 'twitter_url']]\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ename\u003c/th\u003e\n      \u003cth\u003etwitter_url\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003eKaty Perry\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/katyperry\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n  \u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat album is the song \"Gone, Gone, Gone\" in?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\ndf = await conn_musixmatch.query(\"track_matches\", q_track = \"Gone, Gone, Gone\")\n\ndf[['name', 'album_name']]\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ename\u003c/th\u003e\n      \u003cth\u003ealbum_name\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003eGone, Gone, Gone\u003c/td\u003e\n      \u003ctd\u003eThe World From the Side of the Moon\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eWhich artist/artists group is most popular in Canada?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\ndf = await conn_musixmatch.query(\"top_artists\", country = \"Canada\")\n\ndf['name'][0]\n```\n\n\n\n\n    'BTS'\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eHow many genres are in the Musixmatch database?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\ndf = await conn_musixmatch.query(\"genres\")\n\nlen(df)\n```\n\n\n\n\n    362\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWho is the most popular American artist named Michael?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token}, _concurrency = 5)\n\ndf = await conn_musixmatch.query(\"artists\", q_artist = \"Michael\")\ndf = df[df['country'] == \"US\"].sort_values('rating', ascending=False)\n\ndf['name'].iloc[0]\n```\n\n\n\n\n    'Michael Jackson'\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the genre of the album \"Atlas\"?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\nalbum = await conn_musixmatch.query(\"album_info\", album_id = 11339785)\ngenres = await conn_musixmatch.query(\"genres\")\nalbum_genre = genres[genres['id'] == album['genre_id'][0][0]]['name']\n\nalbum_genre.iloc[0]\n```\n\n\n\n\n    'Soundtrack'\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the link to lyrics of the most popular song in the album \"Yellow\"?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token}, _concurrency = 5)\n\ndf = await conn_musixmatch.query(\"album_tracks\", album_id = 10266231)\ndf = df.sort_values('rating', ascending=False)\n\ndf['track_share_url'].iloc[0]\n```\n\n\n\n\n    'https://www.musixmatch.com/lyrics/Coldplay/Yellow?utm_source=application\u0026utm_campaign=api\u0026utm_medium=SFU%3A1409620992740'\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWhat are Lady Gaga's albums from most to least recent?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token}, update = True)\n\ndf = await conn_musixmatch.query(\"artist_albums\", artist_mbid = \"650e7db6-b795-4eb5-a702-5ea2fc46c848\", s_release_date = \"desc\")\n\ndf.name.unique()\n```\n\n\n\n\n    array(['Chromatica', 'Stupid Love',\n           'A Star Is Born (Original Motion Picture Soundtrack)', 'Your Song'],\n          dtype=object)\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWhich artists are similar to Lady Gaga?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\ndf = await conn_musixmatch.query(\"related_artists\", artist_mbid = \"650e7db6-b795-4eb5-a702-5ea2fc46c848\")\n\ndf\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eid\u003c/th\u003e\n      \u003cth\u003ename\u003c/th\u003e\n      \u003cth\u003erating\u003c/th\u003e\n      \u003cth\u003ecountry\u003c/th\u003e\n      \u003cth\u003etwitter_url\u003c/th\u003e\n      \u003cth\u003eupdated_time\u003c/th\u003e\n      \u003cth\u003eartist_alias_list\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003e6985\u003c/td\u003e\n      \u003ctd\u003eCast\u003c/td\u003e\n      \u003ctd\u003e41\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n      \u003ctd\u003e2015-03-29T03:32:49Z\u003c/td\u003e\n      \u003ctd\u003e[キャスト]\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e1\u003c/th\u003e\n      \u003ctd\u003e7014\u003c/td\u003e\n      \u003ctd\u003eblack eyed peas\u003c/td\u003e\n      \u003ctd\u003e77\u003c/td\u003e\n      \u003ctd\u003eUS\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/bep\u003c/td\u003e\n      \u003ctd\u003e2016-06-30T10:07:05Z\u003c/td\u003e\n      \u003ctd\u003e[The Black Eyed Peas, ブラック・アイド・ピーズ, heiyandoud...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2\u003c/th\u003e\n      \u003ctd\u003e269346\u003c/td\u003e\n      \u003ctd\u003eOneRepublic\u003c/td\u003e\n      \u003ctd\u003e74\u003c/td\u003e\n      \u003ctd\u003eUS\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/OneRepublic\u003c/td\u003e\n      \u003ctd\u003e2015-01-07T08:21:52Z\u003c/td\u003e\n      \u003ctd\u003e[ワンリパブリツク, Gong He Shi Dai, Timbaland presents...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003ctd\u003e276451\u003c/td\u003e\n      \u003ctd\u003eTaio Cruz\u003c/td\u003e\n      \u003ctd\u003e60\u003c/td\u003e\n      \u003ctd\u003eGB\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n      \u003ctd\u003e2016-06-30T10:32:58Z\u003c/td\u003e\n      \u003ctd\u003e[タイオ クルーズ, tai ou ke lu zi, Trio Cruz, Jacob M...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003ctd\u003e409736\u003c/td\u003e\n      \u003ctd\u003eInna\u003c/td\u003e\n      \u003ctd\u003e54\u003c/td\u003e\n      \u003ctd\u003eRO\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/inna_ro\u003c/td\u003e\n      \u003ctd\u003e2014-11-13T03:37:43Z\u003c/td\u003e\n      \u003ctd\u003e[インナ]\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e5\u003c/th\u003e\n      \u003ctd\u003e475281\u003c/td\u003e\n      \u003ctd\u003eSkrillex\u003c/td\u003e\n      \u003ctd\u003e62\u003c/td\u003e\n      \u003ctd\u003eUS\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/Skrillex\u003c/td\u003e\n      \u003ctd\u003e2013-11-05T11:28:57Z\u003c/td\u003e\n      \u003ctd\u003e[スクリレックス, shi qi lei ke si, Sonny, Skillrex]\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e6\u003c/th\u003e\n      \u003ctd\u003e13895270\u003c/td\u003e\n      \u003ctd\u003eImagine Dragons\u003c/td\u003e\n      \u003ctd\u003e82\u003c/td\u003e\n      \u003ctd\u003eUS\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/Imaginedragons\u003c/td\u003e\n      \u003ctd\u003e2013-11-05T11:30:28Z\u003c/td\u003e\n      \u003ctd\u003e[イマジン・ドラゴンズ, IMAGINE DRAGONS]\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e7\u003c/th\u003e\n      \u003ctd\u003e27846837\u003c/td\u003e\n      \u003ctd\u003eShawn Mendes\u003c/td\u003e\n      \u003ctd\u003e80\u003c/td\u003e\n      \u003ctd\u003eCA\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n      \u003ctd\u003e2015-02-17T10:33:56Z\u003c/td\u003e\n      \u003ctd\u003e[ショーン・メンデス, xiaoenmengdezi]\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e8\u003c/th\u003e\n      \u003ctd\u003e33491890\u003c/td\u003e\n      \u003ctd\u003eRihanna\u003c/td\u003e\n      \u003ctd\u003e81\u003c/td\u003e\n      \u003ctd\u003eGB\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/rihanna\u003c/td\u003e\n      \u003ctd\u003e2018-10-15T20:32:58Z\u003c/td\u003e\n      \u003ctd\u003e[りあーな, Rihanna, 蕾哈娜, Rhianna, Riannah, Robyn R...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e9\u003c/th\u003e\n      \u003ctd\u003e33491981\u003c/td\u003e\n      \u003ctd\u003eAvicii\u003c/td\u003e\n      \u003ctd\u003e74\u003c/td\u003e\n      \u003ctd\u003eSE\u003c/td\u003e\n      \u003ctd\u003ehttps://twitter.com/avicii\u003c/td\u003e\n      \u003ctd\u003e2018-04-20T18:27:01Z\u003c/td\u003e\n      \u003ctd\u003e[アヴィーチー, ai wei qi, Avicci]\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat are the highest rated songs in Canada from highest to lowest popularity?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token}, _concurrency = 5)\n\ndf = await conn_musixmatch.query(\"top_tracks\", country = 'CA')\n\ndf[df['is_explicit'] == 0].sort_values('rating', ascending = False).reset_index()\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eindex\u003c/th\u003e\n\u003cth\u003eid\u003c/th\u003e\n\u003cth\u003ename\u003c/th\u003e\n\u003cth\u003erating\u003c/th\u003e\n\u003cth\u003ecommontrack_id\u003c/th\u003e\n\u003cth\u003ehas_instrumental\u003c/th\u003e\n\u003cth\u003eis_explicit\u003c/th\u003e\n\u003cth\u003ehas_lyrics\u003c/th\u003e\n\u003cth\u003ehas_subtitles\u003c/th\u003e\n\u003cth\u003ealbum_id\u003c/th\u003e\n\u003cth\u003ealbum_name\u003c/th\u003e\n\u003cth\u003eartist_id\u003c/th\u003e\n\u003cth\u003eartist_name\u003c/th\u003e\n\u003cth\u003etrack_share_url\u003c/th\u003e\n\u003cth\u003eupdated_time\u003c/th\u003e\n\u003cth\u003egenres\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003e5\u003c/td\u003e\n\u003ctd\u003e201621042\u003c/td\u003e\n\u003ctd\u003eDynamite\u003c/td\u003e\n\u003ctd\u003e99\u003c/td\u003e\n\u003ctd\u003e114947355\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e39721115\u003c/td\u003e\n\u003ctd\u003eDynamite - Single\u003c/td\u003e\n\u003ctd\u003e24410130\u003c/td\u003e\n\u003ctd\u003eBTS\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/BTS/Dynamite...\u003c/td\u003e\n\u003ctd\u003e2021-01-15T16:40:48Z\u003c/td\u003e\n\u003ctd\u003e[Pop]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e1\u003c/th\u003e\n\u003ctd\u003e9\u003c/td\u003e\n\u003ctd\u003e187880919\u003c/td\u003e\n\u003ctd\u003eBefore You Go\u003c/td\u003e\n\u003ctd\u003e99\u003c/td\u003e\n\u003ctd\u003e103153140\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-11-20T08:44:05Z\u003c/td\u003e\n\u003ctd\u003e[Pop, Alternative]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e2\u003c/th\u003e\n\u003ctd\u003e7\u003c/td\u003e\n\u003ctd\u003e189704353\u003c/td\u003e\n\u003ctd\u003eBreaking Me\u003c/td\u003e\n\u003ctd\u003e98\u003c/td\u003e\n\u003ctd\u003e105304416\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e34892017\u003c/td\u003e\n\u003ctd\u003eKeep On Loving\u003c/td\u003e\n\u003ctd\u003e42930474\u003c/td\u003e\n\u003ctd\u003eTopic feat. A7S\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Topic-8/Brea...\u003c/td\u003e\n\u003ctd\u003e2021-01-19T16:57:29Z\u003c/td\u003e\n\u003ctd\u003e[House, Dance]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e3\u003c/th\u003e\n\u003ctd\u003e3\u003c/td\u003e\n\u003ctd\u003e189626475\u003c/td\u003e\n\u003ctd\u003eWatermelon Sugar\u003c/td\u003e\n\u003ctd\u003e95\u003c/td\u003e\n\u003ctd\u003e103096346\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e36101498\u003c/td\u003e\n\u003ctd\u003eFine Line\u003c/td\u003e\n\u003ctd\u003e24505463\u003c/td\u003e\n\u003ctd\u003eHarry Styles\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Harry-Styles...\u003c/td\u003e\n\u003ctd\u003e2020-02-14T08:07:12Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\u003c/details\u003e  \n\u003cdetails\u003e\n\u003csummary\u003eWhat are other songs in the same album as the song \"Before You Go\"?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”musixmatch_access_token“ by registering as a developer https://developer.musixmatch.com/signup\nconn_musixmatch = connect(\"musixmatch\", _auth={\"access_token\":musixmatch_access_token})\n\nsong = await conn_musixmatch.query(\"track_info\", commontrack_id = 103153140)\nalbum = await conn_musixmatch.query(\"album_tracks\", album_id = song[\"album_id\"][0])\n\nalbum\n```\n\n\n\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n\u003cthead\u003e\n\u003ctr style=\"text-align: right;\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eid\u003c/th\u003e\n\u003cth\u003ename\u003c/th\u003e\n\u003cth\u003erating\u003c/th\u003e\n\u003cth\u003ecommontrack_id\u003c/th\u003e\n\u003cth\u003ehas_instrumental\u003c/th\u003e\n\u003cth\u003eis_explicit\u003c/th\u003e\n\u003cth\u003ehas_lyrics\u003c/th\u003e\n\u003cth\u003ehas_subtitles\u003c/th\u003e\n\u003cth\u003ealbum_id\u003c/th\u003e\n\u003cth\u003ealbum_name\u003c/th\u003e\n\u003cth\u003eartist_id\u003c/th\u003e\n\u003cth\u003eartist_name\u003c/th\u003e\n\u003cth\u003etrack_share_url\u003c/th\u003e\n\u003cth\u003eupdated_time\u003c/th\u003e\n\u003cth\u003egenres\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003e0\u003c/th\u003e\n\u003ctd\u003e186884178\u003c/td\u003e\n\u003ctd\u003eGrace\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e87857108\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-04-09T10:21:29Z\u003c/td\u003e\n\u003ctd\u003e[Folk-Rock]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e1\u003c/th\u003e\n\u003ctd\u003e186884184\u003c/td\u003e\n\u003ctd\u003eBruises\u003c/td\u003e\n\u003ctd\u003e68\u003c/td\u003e\n\u003ctd\u003e70395936\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2020-07-31T12:58:04Z\u003c/td\u003e\n\u003ctd\u003e[Music, Alternative]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e2\u003c/th\u003e\n\u003ctd\u003e186884187\u003c/td\u003e\n\u003ctd\u003eHold Me While You Wait\u003c/td\u003e\n\u003ctd\u003e89\u003c/td\u003e\n\u003ctd\u003e95176135\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2020-08-02T07:23:21Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e3\u003c/th\u003e\n\u003ctd\u003e186884189\u003c/td\u003e\n\u003ctd\u003eSomeone You Loved\u003c/td\u003e\n\u003ctd\u003e95\u003c/td\u003e\n\u003ctd\u003e89461086\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2020-06-22T15:34:07Z\u003c/td\u003e\n\u003ctd\u003e[Pop, Alternative]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003ctd\u003e186884190\u003c/td\u003e\n\u003ctd\u003eMaybe\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e95541701\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-05-20T11:41:00Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e5\u003c/th\u003e\n\u003ctd\u003e186884191\u003c/td\u003e\n\u003ctd\u003eForever\u003c/td\u003e\n\u003ctd\u003e67\u003c/td\u003e\n\u003ctd\u003e95541702\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-11-18T10:46:36Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e6\u003c/th\u003e\n\u003ctd\u003e186884192\u003c/td\u003e\n\u003ctd\u003eOne\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e95541699\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-05-19T04:08:23Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e7\u003c/th\u003e\n\u003ctd\u003e186884193\u003c/td\u003e\n\u003ctd\u003eDon't Get Me Wrong\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e95541698\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-12-20T08:25:26Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e8\u003c/th\u003e\n\u003ctd\u003e186884194\u003c/td\u003e\n\u003ctd\u003eHollywood\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e95541700\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2019-05-21T08:00:54Z\u003c/td\u003e\n\u003ctd\u003e[Music]\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003cth\u003e9\u003c/th\u003e\n\u003ctd\u003e186884195\u003c/td\u003e\n\u003ctd\u003eLost on You\u003c/td\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003e73530089\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e35611759\u003c/td\u003e\n\u003ctd\u003eDivinely Uninspired To A Hellish Extent (Exten...\u003c/td\u003e\n\u003ctd\u003e33258132\u003c/td\u003e\n\u003ctd\u003eLewis Capaldi\u003c/td\u003e\n\u003ctd\u003ehttps://www.musixmatch.com/lyrics/Lewis-Capald...\u003c/td\u003e\n\u003ctd\u003e2020-03-17T08:35:18Z\u003c/td\u003e\n\u003ctd\u003e[Alternative]\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/details\u003e  \n\n#### [Spotify](./api-connectors/spotify) -- Collect Albums, Artists, and Tracks Metadata\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow many followers does Eminem have?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\ndf = await conn_spotify.query(\"artist\", q=\"Eminem\", _count=500)\n\ndf.loc[df['# followers'].idxmax(), '# followers']\n```\n\n\n\n\n    41157398\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eHow many singles does Pink Floyd have that are available in Canada?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\nartist_name = \"Pink Floyd\"\ndf = await conn_spotify.query(\"album\", q = artist_name, _count = 500)\n\ndf = df.loc[[(artist_name in x) for x in df['artist']]]\ndf = df.loc[[('CA' in x) for x in df['available_markets']]]\ndf = df.loc[df['total_tracks'] == '1']\ndf.shape[0]\n```\n\n    12\n  \u003c/details\u003e  \n\n\u003cdetails\u003e\n  \u003csummary\u003eIn the last quarter of 2020, which artist released the album with the most tracks?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport pandas as pd\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\ndf = await conn_spotify.query(\"album\", q = \"2020\", _count = 500)\n\ndf['date'] = pd.to_datetime(df['release_date'])\ndf = df[df['date'] \u003e '2020-10-01'].drop(columns = ['image url', 'external urls', 'release_date'])\ndf['total_tracks'] = df['total_tracks'].astype(int)\ndf = df.loc[df['total_tracks'].idxmax()]\nprint(df['album_name'] + \", by \" + df['artist'][0] + \", tracks: \" + str(df['total_tracks']))\n```\n\n    ASOT 996 - A State Of Trance Episode 996 (Top 50 Of 2020 Special), by Armin van Buuren ASOT Radio, tracks: 172\n\n  \u003c/details\u003e  \n\u003cdetails\u003e\n  \u003csummary\u003eWho is the most popular artist: Eminem, Beyonce, Pink Floyd and Led Zeppelin\u003c/summary\u003e\n\n```python\n# and what are their popularity ratings?\nfrom dataprep.connector import connect\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\nartists_and_num_followers = []\nfor artist in ['Beyonce', 'Pink Floyd', 'Eminem', 'Led Zeppelin']:\n    df = await conn_spotify.query(\"artist\", q = artist, _count = 500) \n    num_followers = df.loc[df['# followers'].idxmax(), 'popularity']\n    artists_and_num_followers.append((artist, num_followers))\n\nprint(sorted(artists_and_num_followers, key=lambda x: x[1], reverse=True))\n```\n\n    [('Eminem', 94.0), ('Beyonce', 88.0), ('Pink Floyd', 83.0), ('Led Zeppelin', 81.0)]```python\n\n\u003c/details\u003e \n\u003cdetails\u003e\n  \u003csummary\u003eWho are the top 5 artists with the most followers from the current Billboard top 100 artists?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nfrom bs4 import BeautifulSoup\nimport requests\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\nweb_page = requests.get(\"https://www.billboard.com/charts/artist-100\")\nhtml_soup = BeautifulSoup(web_page.text, 'html.parser')\nartist_100 = html_soup.find_all('span', class_ = 'chart-list-item__title-text')\n\nartists = {}\nartists_top5 = []\nfor artist in artist_100:\n    df_temp = await conn_spotify.query(\"artist\", q = artist.text.strip(), _count = 10)\n    df_temp = df_temp.loc[df_temp['popularity'].idxmax()]\n    artists[df_temp['name']] = df_temp['# followers']\nartists_top5 = sorted(artists, key = artists.get, reverse = True)[:5]\nartists_top5\n```\n\n\n\n\n    ['Ed Sheeran', 'Ariana Grande', 'Drake', 'Justin Bieber', 'Eminem']\n\n\u003c/details\u003e \n\u003cdetails\u003e\n  \u003csummary\u003eFor a list of top 10 most popular albums from rollingstone.com which album has most selling markets (countries) around the world in 2020?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport asyncio\n\n# You can get ”spotify_client_id“ and \"spotify_client_secret\" by registering as a developer https://developer.spotify.com/dashboard/#\nconn_spotify = connect(\"spotify\", _auth={\"client_id\":spotify_client_id, \"client_secret\":spotify_client_secret}, _concurrency=3)\n\ndef count_markets(text):\n    lst = text.split(',')\n    return len(lst)\n\nalbum_artists = [\"Folklore\", \"Fetch the Bolt Cutters\", \"YHLQMDLG\", \"Rough and Rowdy Ways\", \"Future Nostalgia\",\n                 \"RTJ4\", \"Saint Cloud\", \"Eternal Atake\", \"What’s Your Pleasure\", \"Punisher\"]\n\nalbum_list = [conn_spotify.query(\"album\", q = name, _count = 1) for name in album_artists]\ncombined = asyncio.gather(*album_list)\ndf = pd.concat(await combined).reset_index()\ndf = df.drop(columns = ['image url', 'external urls', 'index'])\ndf['market_count'] = df['available_markets'].apply(lambda x: count_markets(x))\ndf = df.loc[df['market_count'].idxmax()]\nprint(df['album_name'] + \", by \" + df['artist'][0] + \", with \" + str(df['market_count']) + \" avalible countries\")\n```\n\n\n    folklore, by Taylor Swift, with 92 avalible countries\n\n\n​    \n\u003c/details\u003e \n\n#### [iTunes](./api-connectors/itunes) -- Collect iTunes Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are all Jack Johnson audio and video content?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_itunes = connect('itunes')\ndf = await conn_itunes.query('search', term=\"jack+johnson\")\ndf\n```\n\n|   id |  Type | kind |   artistName |                                    collectionName |                 trackName | trackTime |\n| ---: | ----: | ---: | -----------: | ------------------------------------------------: | ------------------------: | --------- |\n|    0 | track | song | Jack Johnson | Jack Johnson and Friends: Sing-A-Longs and Lul... |               Upside Down | 208643    |\n|    1 | track | song | Jack Johnson |           In Between Dreams (Bonus Track Version) |           Better Together | 207679    |\n|    2 | track | song | Jack Johnson |           In Between Dreams (Bonus Track Version) | Sitting, Waiting, Wishing | 183721    |\n|  ... |   ... |  ... |          ... |                                               ... |                       ... | ...       |\n|   49 | track | song | Jack Johnson |                          Sleep Through the Static |             While We Wait | 86112     |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to compute the average track time of Rich Brian's music videos?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_itunes = connect('itunes')\ndf = await conn_itunes.query(\"search\", term=\"rich+brian\", entity=\"musicVideo\")\navg_track_time = df['trackTime'].mean()/(1000*60)\nprint(\"The average track time is {:.3} minutes.\".format(avg_track_time))\n```\n\nThe average track time is 4.13 minutes.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to get all Ang Lee's movies which are made in the Unite States?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\nconn_itunes = connect('itunes')\ndf = await conn_itunes.query(\"search\", term=\"Ang+Lee\", entity=\"movie\", country=\"us\")\ndf = df[df['artistName']=='Ang Lee']\ndf\n```\n\n| id  | type  | kind          | artistName | collectionName              | trackName           | trackTime |\n| --- | ----- | ------------- | ---------- | --------------------------- | ------------------- | --------- |\n| 0   | track | feature-movie | Ang Lee    | Fox 4K HDR Drama Collection | Life of Pi          | 7642675   |\n| 1   | track | feature-movie | Ang Lee    | None                        | Gemini Man          | 7049958   |\n| ... | ...   | ...           | ...        | ...                         | ...                 | ...       |\n| 11  | track | feature-movie | Ang Lee    | None                        | Ride With the Devil | 8290498   |\n\u003c/details\u003e\n\n### Networking\n\n#### [IPLegit](./api-connectors/iplegit) -- Collect IP Address Data\n\n\u003cdetails\u003e\n\u003csummary\u003eHow can I check if an IP address is bad, so I can block it from accessing my website?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”iplegit_access_token“ by registering as a developer https://rapidapi.com/IPLegit/api/iplegit\nconn_iplegit = connect('iplegit', _auth={'access_token':iplegit_access_token})\n\nip_addresses = ['16.210.143.176', \n                '98.124.198.1', \n                '182.50.236.215', \n                '90.104.138.217', \n                '61.44.131.150', \n                '210.64.150.243', \n                '89.141.156.184']\n\nfor ip in ip_addresses:\n    ip_status = await conn_iplegit.query('status', ip=ip)\n    bad_status = ip_status['bad_status'].get(0)\n    if bad_status == True:\n        print('block ip address: ', ip_status['ip'].get(0))\n```\n\nblock ip address:  98.124.198.1\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat country are most people from who have visited my website?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport pandas as pd\n\n# You can get ”iplegit_access_token“ by registering as a developer https://rapidapi.com/IPLegit/api/iplegit\nconn_iplegit = connect('iplegit', _auth={'access_token':iplegit_access_token})\n\nip_addresses = ['16.210.143.176', \n                '98.124.198.1', \n                '182.50.236.215', \n                '90.104.138.217', \n                '61.44.131.150', \n                '210.64.150.243', \n                '89.141.156.184',\n                '85.94.168.133', \n                '98.14.201.52', \n                '98.57.106.207', \n                '185.254.139.250', \n                '206.246.126.82', \n                '147.44.75.68', \n                '123.42.224.40', \n                '253.29.140.44', \n                '97.203.209.153', \n                '196.63.36.253']\n\nip_details = []\nfor ip in ip_addresses:\n    ip_details.append(await conn_iplegit.query('details', ip=ip))\n\ndf = pd.concat(ip_details)\ndf.country.mode().get(0)\n```\n\n\n\n\n'UNITED STATES'\n\n\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMake a map showing locations of people who have visited my website.\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport pandas as pd\nfrom shapely.geometry import Point\nimport geopandas as gpd\nfrom geopandas import GeoDataFrame\n\n# You can get ”iplegit_access_token“ by registering as a developer https://rapidapi.com/IPLegit/api/iplegit\nconn_iplegit = connect('iplegit', _auth={'access_token':iplegit_access_token})\n\nip_addresses = ['16.210.143.176', \n                '98.124.198.1', \n                '182.50.236.215', \n                '90.104.138.217', \n                '61.44.131.150', \n                '210.64.150.243', \n                '89.141.156.184',\n                '85.94.168.133', \n                '98.14.201.52', \n                '98.57.106.207', \n                '185.254.139.250', \n                '206.246.126.82', \n                '147.44.75.68', \n                '123.42.224.40', \n                '253.29.140.44', \n                '97.203.209.153', \n                '196.63.36.253']\n\nip_details = []\nfor ip in ip_addresses:\n    ip_details.append(await conn_iplegit.query('details', ip=ip))\n\ndf = pd.concat(ip_details)\ngeometry = [Point(xy) for xy in zip(df['longitude'], df['latitude'])]\ngdf = GeoDataFrame(df, geometry=geometry)   \n\nworld = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\ngdf.plot(ax=world.plot(figsize=(10, 6)), marker='o', color='red', markersize=15);\n```\n\n\n\n![png](assets/iplegit_map.png)\n\n\n\n\n\u003c/details\u003e\n\n\n### News\n\n\n#### [Guardian](./api-connectors/guardian) -- Collect Guardian News Data \n\u003cdetails\u003e\n  \u003csummary\u003eWhich news section contain most mentions related to bitcoin ?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect, info, Connector\nimport pandas as pd\n\nconn_guardian = connect('guardian', update = True, _auth={'access_token': API_key}, concurrency=3)\ndf3 = await conn_guardian.query('article', _q='covid 19', _count=1000)\ndf3.groupby('section').count().sort_values(\"headline\", ascending=False)\n\n```\n| section                            | headline | url | publish_date |\n| ---------------------------------- | -------- | --- | ------------ |\n|                                    |          |     |              |\n| World news                         | 378      | 378 | 378          |\n| Business                           | 103      | 103 | 103          |\n| US news                            | 76       | 76  | 76           |\n| Opinion                            | 72       | 72  | 72           |\n| Sport                              | 53       | 53  | 53           |\n| Australia news                     | 49       | 49  | 49           |\n| Society                            | 44       | 44  | 44           |\n| Politics                           | 34       | 34  | 34           |\n| Football                           | 28       | 28  | 28           |\n| Global development                 | 26       | 26  | 26           |\n| UK news                            | 26       | 26  | 26           |\n| Education                          | 17       | 17  | 17           |\n| Environment                        | 14       | 14  | 14           |\n| Technology                         | 10       | 10  | 10           |\n| Film                               | 10       | 10  | 10           |\n| Science                            | 8        | 8   | 8            |\n| Books                              | 8        | 8   | 8            |\n| Life and style                     | 7        | 7   | 7            |\n| Television \u0026 radio                 | 6        | 6   | 6            |\n| Media                              | 4        | 4   | 4            |\n| Culture                            | 4        | 4   | 4            |\n| Stage                              | 4        | 4   | 4            |\n| News                               | 4        | 4   | 4            |\n| Travel                             | 2        | 2   | 2            |\n| WEHI: Brighter together            | 2        | 2   | 2            |\n| Xero: Resilient business           | 2        | 2   | 2            |\n| Money                              | 2        | 2   | 2            |\n| The new rules of work              | 1        | 1   | 1            |\n| LinkedIn: Hybrid workplace         | 1        | 1   | 1            |\n| Global                             | 1        | 1   | 1            |\n| Getting back on track              | 1        | 1   | 1            |\n| Westpac Scholars: Rethink tomorrow | 1        | 1   | 1            |\n| Food                               | 1        | 1   | 1            |\n| All together                       | 1        | 1   | 1            |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eFind articles with covid precautions ?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect, Connector\n\nconn_guardian = connect('guardian', update = True, _auth={'access_token': API_key}, concurrency=3)\ndf2 = await conn_guardian.query('article', _q='covid 19 protect',  _count=100)\ndf2[df2.section=='Opinion']\n```\n| id  | headline                                          | section | url                                               | publish_date         |\n| --- | ------------------------------------------------- | ------- | ------------------------------------------------- | -------------------- |\n| 0   | Billionaires made $1tn since Covid-19. They ca... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-09T11:32:20Z |\n| 1   | Jeff Bezos became even richer thanks to Covid-... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-13T07:30:00Z |\n| 20  | Here's how to tackle the Covid-19 anti-vaxxers... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-11-26T16:02:14Z |\n| 41  | Can the UK deliver on the Covid vaccine rollou... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-11T09:00:24Z |\n| 68  | Covid-19 has turned back the clock on working ... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-10T14:19:27Z |\n| 84  | The Guardian view on Covid-19 promises: season... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-14T18:42:10Z |\n| 88  | The Guardian view on responding to the Covid-1... | Opinion | https://www.theguardian.com/commentisfree/2020... | 2020-12-30T18:58:05Z |\n\u003c/details\u003e\n\n#### [Times](./api-connectors/times) -- Collect New York Times Data\n\u003cdetails\u003e\n  \u003csummary\u003eWho is the author of article 'Yellen Outlines Economic Priorities, and Republicans Draw Battle Lines'\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”times_access_token“ by following https://developer.nytimes.com/apis\nconn_times = connect(\"times\", _auth={\"access_token\":times_access_token})\ndf = await conn_times.query('ac',q='Yellen Outlines Economic Priorities, and Republicans Draw Battle Lines')\ndf[[\"authors\"]]\n```\n|   id | authors           |\n| ---: | :---------------- |\n|    0 | By Alan Rappeport |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the newest news from Ottawa\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”times_access_token“ by following https://developer.nytimes.com/apis\nconn_times = connect(\"times\", _auth={\"access_token\":times_access_token})\ndf = await conn_times.query('ac',q=\"ottawa\",sort='newest')\ndf[['headline','authors','abstract','url','pub_date']].head(1)\n```\n|      | headline                                                      | ...  | pub_date                 |\n| ---: | :------------------------------------------------------------ | :--- | :----------------------- |\n|    0 | 21 Men Accuse Lincoln Project Co-Founder of Online Harassment | ...  | 2021-01-31T14:48:35+0000 |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are Headlines of articles where Trump was mentioned in the last 6 months of 2020 in the technology news section\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”times_access_token“ by following https://developer.nytimes.com/apis\nconn_times = connect(\"times\", _auth={\"access_token\":times_access_token})\ndf = await conn_times.query('ac',q=\"Trump\",fq='section_name:(\"technology\")',begin_date='20200630',end_date='20201231',sort='newest', _count=50)\n\nprint(df['headline'])\nprint(\"Trump was mentioned in \" + str(len(df)) + \" articles\")\n```\n|   id | headline                                                                           |\n| ---: | :--------------------------------------------------------------------------------- |\n|    0 | No, Trump cannot win Georgia’s electoral votes through a write-in Senate campaign. |\n|    1 | How Misinformation ‘Superspreaders’ Seed False Election Theories                   |\n|    2 | No, Trump’s sister did not publicly back him. He was duped by a fake account.      |\n|   .. | ...                                                                                |\n|   49 | Trump Official’s Tweet, and Its Removal, Set Off Flurry of Anti-Mask Posts         |\n\nTrump was mentioned in 50 articles\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat is the ranking of times a celebrity is mentioned in a headline in latter half of 2020?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\nimport pandas as pd\n# You can get ”times_access_token“ by following https://developer.nytimes.com/apis\nconn_times = connect(\"times\", _auth={\"access_token\":times_access_token})\nceleb_list = ['Katy Perry', 'Taylor Swift', 'Lady Gaga', 'BTS', 'Rihanna', 'Kim Kardashian']\nnumber_of_mentions = []\nfor i in celeb_list:\n    df1 = await conn_times.query('ac',q=i,begin_date='20200630',end_date='20201231')\n    df1 = df1[df1['headline'].str.contains(i)]\n    a = len(df1['headline'])\n    number_of_mentions.append(a)\n\nprint(number_of_mentions)\n    \nranking_df = pd.DataFrame({'name': celeb_list, 'number of mentions': number_of_mentions})\nranking_df = ranking_df.sort_values(by=['number of mentions'], ascending=False)\nranking_df\n```\n[2, 6, 3, 6, 1, 0]\n\n|      | name           | number of mentions |\n| ---: | :------------- | -----------------: |\n|    1 | Taylor Swift   |                  6 |\n|    3 | BTS            |                  6 |\n|    2 | Lady Gaga      |                  3 |\n|    0 | Katy Perry     |                  2 |\n|    4 | Rihanna        |                  1 |\n|    5 | Kim Kardashian |                  0 |\n\u003c/details\u003e\n\n#### [Currents](./api-connectors/currents) -- Collect Currents News Data\n\u003cdetails\u003e\n  \u003csummary\u003eHow to get latest Chinese news?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN\nconn_currents = connect('currents', _auth={'access_token': currents_access_token})\ndf = await conn_currents.query('latest_news', language='zh')\ndf.head()\n```\n|   id | title                | category       | ...  | author   | published                 |\n| ---: | :------------------- | :------------- | :--- | :------- | :------------------------ |\n|    0 | 為何上市公司該汰換了 | [entrepreneur] | ...  | 經濟日報 | 2021-02-03 08:48:39 +0000 |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to get the political news about 'Trump'?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN\nconn_currents = connect('currents', _auth={'access_token': currents_access_token})\ndf = await conn_currents.query('search', keywords='Trump', category='politics')\ndf.head(3)\n```\n|      | title                                                                                                        | category              | description                                                                                                                    | url                                                                                                               | author        | published                 |\n| ---: | :----------------------------------------------------------------------------------------------------------- | :-------------------- | :----------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | :------------ | :------------------------ |\n|    0 | Biden Started The Process Of Unwinding Trump's Assault On Immigration, But Activists Want Him To Move Faster | ['politics', 'world'] | \"These people cannot continue to wait.\"                                                                                        | https://www.buzzfeednews.com/article/adolfoflores/biden-immigration-executive-orders-review                       | Adolfo Flores | 2021-02-03 08:39:51 +0000 |\n|    1 | Pro-Trump lawyer Lin Wood reportedly under investigation for voter fraud                                     | ['politics', 'world'] | A source told CBS Atlanta affiliate WGCL that Lin Wood is being investigated for allegedly voting \"out of state.\"              | https://www.cbsnews.com/news/pro-trump-lawyer-lin-wood-under-investigation-for-alleged-illegal-voting-2020-02-03/ | April Siese   | 2021-02-03 08:21:25 +0000 |\n|    2 | Trump Supporters Say They Attacked The Capitol Because He Told Them To, Undercutting His Impeachment Defense | ['politics', 'world'] | “President Trump told Us to ‘fight like hell,’” one Trump supporter reportedly posted online after the assault on the Capitol. | https://www.buzzfeednews.com/article/zoetillman/trump-impeachment-capitol-rioters-fight-like-hell                 | Zoe Tillman   | 2021-02-03 07:25:34 +0000 |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to get the news about COVID-19 from 2020-12-25?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN\nconn_currents = connect('currents', _auth={'access_token': currents_access_token})\ndf = await conn_currents.query('search', keywords='covid', start_date='2020-12-25',end_date='2020-12-25')\ndf.head(1)\n```\n\n|      | title                                                               | category    | ...  | published                 |\n| ---: | :------------------------------------------------------------------ | :---------- | :--- | :------------------------ |\n|    0 | Commentary: Let our charitable giving equal our political donations | ['opinion'] | ...  | 2020-12-25 00:00:00 +0000 |\n\u003c/details\u003e\n\n\n### Science\n\n#### [DBLP](./api-connectors/dblp) -- Collect Computer Science Publication Data\n\n\u003cdetails\u003e\n  \u003csummary\u003eWho wrote this paper?\u003c/summary\u003e\n\n  ```python\n  from dataprep.connector import connect\n  conn_dblp = connect(\"dblp\")\n  df = await conn_dblp.query(\"publication\", q = \"Scikit-learn: Machine learning in Python\", _count = 1)\n  df[[\"title\", \"authors\", \"year\"]]\n  ```\n| id  | title                                      | authors                                           | year |\n| --- | ------------------------------------------ | ------------------------------------------------- | ---- |\n| 0   | Scikit-learn - Machine Learning in Python. | [Fabian Pedregosa, Gaël Varoquaux, Alexandre G... | 2011 |\n\n  \u003c/details\u003e\n  \u003cdetails\u003e\n  \u003csummary\u003eHow to fetch all publications of Andrew Y. Ng?\u003c/summary\u003e\n\n  ```python\n  from dataprep.connector import connect\n\n  conn_dblp = connect(\"dblp\", _concurrency = 5)\n  df = await conn_dblp.query(\"publication\", author = \"Andrew Y. Ng\", _count = 2000)\n  df[[\"title\", \"authors\", \"venue\", \"year\"]].reset_index(drop=True)\n  ```\n\n\n| id  | title                                             | authors                                           | venue            | year |\n| --- | ------------------------------------------------- | ------------------------------------------------- | ---------------- | ---- |\n| 0   | The 1st Agriculture-Vision Challenge - Methods... | [Mang Tik Chiu, Xingqian Xu, Kai Wang, Jennife... | [CVPR Workshops] | 2020 |\n| ... | ...                                               | ...                                               | ...              | ...  |\n| 242 | An Experimental and Theoretical Comparison of ... | [Michael J. Kearns, Yishay Mansour, Andrew Y. ... | [COLT]           | 1995 |\n  \u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eHow to fetch all publications of NeurIPS 2020?\u003c/summary\u003e\n\n  ```python\n  from dataprep.connector import connect\n\n  conn_dblp = connect(\"dblp\", _concurrenncy = 5)\n  df = await conn_dblp.query(\"publication\", q = \"NeurIPS 2020\", _count = 5000)\n\n  # filter non-neurips-2020 papers\n  mask = df.venue.apply(lambda x: 'NeurIPS' in x)\n  df = df[mask]\n  df = df[(df['year'] == '2020')]\n  df[[\"title\", \"venue\", \"year\"]].reset_index(drop=True)\n  ```\n| id   | title                                             | venue     | year |\n| ---- | ------------------------------------------------- | --------- | ---- |\n| 0    | Towards More Practical Adversarial Attacks on ... | [NeurIPS] | 2020 |\n| ...  | ...                                               | ...       | ...  |\n| 1899 | Triple descent and the two kinds of overfittin... | [NeurIPS] | 2020 |\n  \u003c/details\u003e\n\n#### [NASA](api-connectors/nasa) -- Collect NASA Data.\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are the title of Astronomy Picture of the Day from 2020-01-01 to 2020-01-10?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”nasa_access_key“ by following https://api.nasa.gov/\nconn_nasa = connect(\"api-connectors/nasa\", _auth={'access_token': nasa_access_key})\n\ndf = await conn_nasa.query(\"apod\", start_date='2020-01-01', end_date='2020-01-10')\ndf['title']\n```\n|   id | title                           |\n| ---: | :------------------------------ |\n|    0 | Betelgeuse Imagined             |\n|    1 | The Fainting of Betelgeuse      |\n|    2 | Quadrantids over the Great Wall |\n|  ... | ...                             |\n|    9 | Nacreous Clouds over Sweden     |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are Coronal Mass Ejection(CME) data from 2020-01-01 to 2020-02-01?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”nasa_access_key“ by following https://api.nasa.gov/\nconn_nasa = connect(\"api-connectors/nasa\", _auth={'access_token': nasa_access_key})\n\ndf = await conn_nasa.query('cme', startDate='2020-01-01', endDate='2020-02-01')\ndf\n```\n\n|   id | activity_id                 | catalog     | start_time        | ...  | link                                                     |\n| ---: | :-------------------------- | :---------- | :---------------- | :--- | :------------------------------------------------------- |\n|    0 | 2020-01-05T16:45:00-CME-001 | M2M_CATALOG | 2020-01-05T16:45Z | ...  | https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/15256/-1 |\n|    1 | 2020-01-14T11:09:00-CME-001 | M2M_CATALOG | 2020-01-14T11:09Z | ...  | https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/15271/-1 |\n|   .. | ...                         | ...         | ...               | ...  | ...                                                      |\n|    4 | 2020-01-25T18:54:00-CME-001 | M2M_CATALOG | 2020-01-25T18:54Z | ...  | https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/15296/-1 |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow many Geomagnetic Storms(GST) have occurred from 2020-01-01 to 2021-01-01? When is it?\u003c/summary\u003e\n\n```python\nfrom dataprep.connector import connect\n\n# You can get ”nasa_access_key“ by following https://api.nasa.gov/\nconn_nasa = connect(\"api-connectors/nasa\", _auth={'access_token': nasa_access_key})\n\ndf = await conn_nasa.query('gst', startDate='2020-01-01', endDate='2021-01-01')\nprint(\"Geomagnetic Storms have occurred %s times from 2020-01-01 to 2021-01-01.\" % len(df))\ndf['start_time']\n```\nGeomagnetic Storms have occurred 1 times from 2020-01-01 to 2021-01-01.\n\n|   id | start_time        |\n| ---: | :---------------- |\n|    0 | 2020-09-27T21:00Z |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow many Solar Flare(FLR) have occurred and completed from 2020-01-01 to 2021-01-01? How long did they last?\u003c/summary\u003e\n\n```python\nimport pandas as pd\nfrom dataprep.connector import connect\n\n# You can get ”nasa_access_key“ by following https://api.nasa.gov/\nconn_nasa = connect(\"api-connectors/nasa\", _auth={'access_token': nasa_access_key})\n\ndf = await conn_nasa.query('flr', startDate='2020-01-01', endDate='2021-01-01')\ndf = df.dropna(subset=['end_time']).reset_index(drop=True)\ndf['duration'] = pd.to_datetime(df['end_time']) - pd.to_datetime(df['begin_time'])\nprint('Solar Flare have occurred %s times from 2020-01-01 to 2021-01-01.' % len(df))\nprint(df['duration'])\n```\nThere are 1 times Geomagnetic Storms(GST) have occurred from 2020-01-01 to 2021-01-01.\n\n|   id | duration        |\n| ---: | :-------------- |\n|    0 | 0 days 01:07:00 |\n|    1 | 0 days 00:23:00 |\n|    2 | 0 days 00:47:00 |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhat are Solar Energetic Particle(SEP) data from 2019-01-01 to 2021-01-01?\u003c/summary\u003e\n\n```python\nimport pandas as pd\nfrom dataprep.connector import connect\n\n# You can get ”nasa_access_key“ by follow","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfu-db%2Fapiconnectors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsfu-db%2Fapiconnectors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfu-db%2Fapiconnectors/lists"}