{
  "id": 583385,
  "title": "Downloading a Specific File or Folder from a Kaggle Dataset via API",
  "url": "/competitions/waveform-inversion/discussion/583385",
  "author_name": "",
  "post_date": "2025-06-06T12:48:49.610174700Z",
  "votes": 2,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hi,<br>\n\"The competition datasets are very large. I only want to download the dataset inside a specific folder. Is it possible? I checked the API resources, but it downloads the entire dataset every time with the code I wrote.<br>\nExample of the dataset I want to download:<br>\n/kaggle/input/waveform-inversion/train_samples/CurveFault_A/seis2_1_0.npy\"<br>\nThanks.</p>",
  "messages": [
    {
      "id": "3218619",
      "postDate": "06/06/2025 12:48:49",
      "content": "<p>Hi,<br>\n\"The competition datasets are very large. I only want to download the dataset inside a specific folder. Is it possible? I checked the API resources, but it downloads the entire dataset every time with the code I wrote.<br>\nExample of the dataset I want to download:<br>\n/kaggle/input/waveform-inversion/train_samples/CurveFault_A/seis2_1_0.npy\"<br>\nThanks.</p>",
      "rawMarkdown": "Hi,\n\"The competition datasets are very large. I only want to download the dataset inside a specific folder. Is it possible? I checked the API resources, but it downloads the entire dataset every time with the code I wrote.\nExample of the dataset I want to download:\n/kaggle/input/waveform-inversion/train_samples/CurveFault_A/seis2_1_0.npy\"\nThanks.",
      "votes": null
    },
    {
      "id": "3218627",
      "postDate": "06/06/2025 13:08:26",
      "content": "<p>Hi.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fefa033ae71c32b39385aba3fd943e080%2FSin%20ttulo.png?generation=1749215289014752&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fa5dd1b73614f4e5a42621e94f0359b9a%2FSin%20ttulo.png?generation=1749215422812773&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fefa033ae71c32b39385aba3fd943e080%2FSin%20ttulo.png?generation=1749215289014752&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fa5dd1b73614f4e5a42621e94f0359b9a%2FSin%20ttulo.png?generation=1749215422812773&alt=media)",
      "votes": null
    },
    {
      "id": "3218652",
      "postDate": "06/06/2025 13:49:28",
      "content": "<p>I guess what he wanted to ask was how to download using the api instead of the web. Maybe he wanted to download to the server. I know that too, but does huggingface have this function😀</p>",
      "rawMarkdown": "I guess what he wanted to ask was how to download using the api instead of the web. Maybe he wanted to download to the server. I know that too, but does huggingface have this function😀",
      "votes": null
    },
    {
      "id": "3218740",
      "postDate": "06/06/2025 16:37:12",
      "content": "<p>So, how can I download /kaggle/input/waveform-inversion/train_samples/CurveFault_A as a folder? I guess I need to use the API for that.</p>",
      "rawMarkdown": "So, how can I download /kaggle/input/waveform-inversion/train_samples/CurveFault_A as a folder? I guess I need to use the API for that.",
      "votes": null
    },
    {
      "id": "3218745",
      "postDate": "06/06/2025 16:44:34",
      "content": "<p>No, you don't have to. You can just maual download any folder/file in data individually.</p>",
      "rawMarkdown": "No, you don't have to. You can just maual download any folder/file in data individually.",
      "votes": null
    },
    {
      "id": "3218973",
      "postDate": "06/07/2025 02:06:57",
      "content": "<p>It should be possible according to the api documentation at <a href=\"https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md\" target=\"_blank\">https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md</a> ?</p>\n<p>It provides an example of how to download a specific competition file:</p>\n<pre><code>kaggle competitions download favorita-grocery-sales-forecasting -f test.csvz\n</code></pre>\n<p>I tried it and … it does not work!</p>\n<p>According to the doc, this should return the files we can download:</p>\n<pre><code>kaggle competitions files -c waveform-inversion\n</code></pre>\n<p>It yields:</p>\n<pre><code>Next Page Token = &lt;REDACTED&gt;\nname                       size  creationDate                \n-------------------  ----------  --------------------------  \ntest/000039dca2.npy       -04-08 ::  \ntest/0000fd8ec8.npy       -04-08 ::  \ntest/1026c8a.npy       -04-08 ::  \ntest/00015b24d5.npy       -04-08 ::  \ntest/0001e348d0.npy       -04-08 ::  \ntest/00020458d3.npy       -04-08 ::  \ntest/npy       -04-08 ::  \ntest/0002c6e0ec.npy       -04-08 ::  \ntest/0004e3da8f.npy       -04-08 ::  \ntest/0005b32004.npy       -04-08 ::  \ntest/0005f54789.npy       -04-08 ::  \ntest/00073adee0.npy       -04-08 ::  \ntest/000771e81b.npy       -04-08 ::  \ntest/00080a15bb.npy       -04-08 ::  \ntest/00085bb25a.npy       -04-08 ::  \ntest/00092264ec.npy       -04-08 ::  \ntest/000950ea2a.npy       -04-08 ::  \ntest/0009af4c76.npy       -04-08 ::  \ntest/000a5e83b8.npy       -04-08 ::  \ntest/000ad94382.npy       -04-08 ::  \n</code></pre>\n<p>This should download the first one:</p>\n<pre><code>kaggle competitions download -f test/000039dca2.npy waveform-inversion\n</code></pre>\n<p>It returns a 404 error instead.</p>\n<p><a href=\"https://www.kaggle.com/inversion\" target=\"_blank\">@inversion</a> is the above to be expected?</p>",
      "rawMarkdown": "It should be possible according to the api documentation at https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md ?\n\nIt provides an example of how to download a specific competition file:\n\n```python\nkaggle competitions download favorita-grocery-sales-forecasting -f test.csv.7z\n\n```\nI tried it and ... it does not work!\n\nAccording to the doc, this should return the files we can download:\n\n```python\nkaggle competitions files -c waveform-inversion\n\n```\n\nIt yields:\n\n```python\nNext Page Token = <REDACTED>\nname                       size  creationDate                \n-------------------  ----------  --------------------------  \ntest/000039dca2.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0000fd8ec8.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0001026c8a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00015b24d5.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0001e348d0.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00020458d3.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0002189478.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0002c6e0ec.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0004e3da8f.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0005b32004.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0005f54789.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00073adee0.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000771e81b.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00080a15bb.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00085bb25a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00092264ec.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000950ea2a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0009af4c76.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000a5e83b8.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000ad94382.npy     1400128  2025-04-08 19:45:25.389000  \n```\n\nThis should download the first one:\n\n```python\nkaggle competitions download -f test/000039dca2.npy waveform-inversion\n```\n\nIt returns a 404 error instead.\n\n@inversion is the above to be expected?",
      "votes": null
    },
    {
      "id": "3221120",
      "postDate": "06/10/2025 12:39:43",
      "content": "<p>FYI. For example, it would be easier to download the entire file to external storage and then store only the files you need on internal storage.<br>\nYou can use magic commands to download files to a specified directory using the Kaggle CLI on local Notebook.</p>\n<pre><code># [Cell1]. You can use the      the current directory of your choice.\n% tmp_dl/\n</code></pre>\n<pre><code>\n\n\n!kaggle datasets download harshitsheoran/simple-further-finetuned-bartley--models\n</code></pre>\n<p>With the above steps, you can download the file to any directory you like by moving to \"Cell1\".</p>",
      "rawMarkdown": "FYI. For example, it would be easier to download the entire file to external storage and then store only the files you need on internal storage.\nYou can use magic commands to download files to a specified directory using the Kaggle CLI on local Notebook.\n```\n# [Cell1]. You can use the \"%cd\" command to change to the current directory of your choice.\n%cd tmp_dl/\n```\n\n```\n# [Cell2]. Copy and paste the Kaggle CLI command for the dataset you want to download and the download will begin.\n\n#!/bin/bash\n!kaggle datasets download harshitsheoran/simple-further-finetuned-bartley-open-models\n```\n\nWith the above steps, you can download the file to any directory you like by moving to \"Cell1\".",
      "votes": null
    },
    {
      "id": "3221137",
      "postDate": "06/10/2025 13:10:01",
      "content": "<p>Dataset have been uploaded on <a href=\"https://huggingface.co/datasets/ashynf/OpenFWI\" target=\"_blank\">Huggingface</a>. You can download files by huggingface-cli. Or you can also download the specific file by wget command with link got in the huggingface repository.</p>",
      "rawMarkdown": "Dataset have been uploaded on [Huggingface](https://huggingface.co/datasets/ashynf/OpenFWI). You can download files by huggingface-cli. Or you can also download the specific file by wget command with link got in the huggingface repository.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3218627,
      "author_name": "sacuscreed",
      "author_url": "",
      "post_date": "06/06/2025 13:08:26",
      "content": "<p>Hi.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fefa033ae71c32b39385aba3fd943e080%2FSin%20ttulo.png?generation=1749215289014752&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fa5dd1b73614f4e5a42621e94f0359b9a%2FSin%20ttulo.png?generation=1749215422812773&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 3218652,
          "author_name": "waterjoe",
          "author_url": "",
          "post_date": "06/06/2025 13:49:28",
          "content": "<p>I guess what he wanted to ask was how to download using the api instead of the web. Maybe he wanted to download to the server. I know that too, but does huggingface have this function😀</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3218740,
      "author_name": "hdrdmr",
      "author_url": "",
      "post_date": "06/06/2025 16:37:12",
      "content": "<p>So, how can I download /kaggle/input/waveform-inversion/train_samples/CurveFault_A as a folder? I guess I need to use the API for that.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3218745,
          "author_name": "sacuscreed",
          "author_url": "",
          "post_date": "06/06/2025 16:44:34",
          "content": "<p>No, you don't have to. You can just maual download any folder/file in data individually.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3218973,
      "author_name": "cpmpml",
      "author_url": "",
      "post_date": "06/07/2025 02:06:57",
      "content": "<p>It should be possible according to the api documentation at <a href=\"https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md\" target=\"_blank\">https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md</a> ?</p>\n<p>It provides an example of how to download a specific competition file:</p>\n<pre><code>kaggle competitions download favorita-grocery-sales-forecasting -f test.csvz\n</code></pre>\n<p>I tried it and … it does not work!</p>\n<p>According to the doc, this should return the files we can download:</p>\n<pre><code>kaggle competitions files -c waveform-inversion\n</code></pre>\n<p>It yields:</p>\n<pre><code>Next Page Token = &lt;REDACTED&gt;\nname                       size  creationDate                \n-------------------  ----------  --------------------------  \ntest/000039dca2.npy       -04-08 ::  \ntest/0000fd8ec8.npy       -04-08 ::  \ntest/1026c8a.npy       -04-08 ::  \ntest/00015b24d5.npy       -04-08 ::  \ntest/0001e348d0.npy       -04-08 ::  \ntest/00020458d3.npy       -04-08 ::  \ntest/npy       -04-08 ::  \ntest/0002c6e0ec.npy       -04-08 ::  \ntest/0004e3da8f.npy       -04-08 ::  \ntest/0005b32004.npy       -04-08 ::  \ntest/0005f54789.npy       -04-08 ::  \ntest/00073adee0.npy       -04-08 ::  \ntest/000771e81b.npy       -04-08 ::  \ntest/00080a15bb.npy       -04-08 ::  \ntest/00085bb25a.npy       -04-08 ::  \ntest/00092264ec.npy       -04-08 ::  \ntest/000950ea2a.npy       -04-08 ::  \ntest/0009af4c76.npy       -04-08 ::  \ntest/000a5e83b8.npy       -04-08 ::  \ntest/000ad94382.npy       -04-08 ::  \n</code></pre>\n<p>This should download the first one:</p>\n<pre><code>kaggle competitions download -f test/000039dca2.npy waveform-inversion\n</code></pre>\n<p>It returns a 404 error instead.</p>\n<p><a href=\"https://www.kaggle.com/inversion\" target=\"_blank\">@inversion</a> is the above to be expected?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3221120,
      "author_name": "hideyukizushi",
      "author_url": "",
      "post_date": "06/10/2025 12:39:43",
      "content": "<p>FYI. For example, it would be easier to download the entire file to external storage and then store only the files you need on internal storage.<br>\nYou can use magic commands to download files to a specified directory using the Kaggle CLI on local Notebook.</p>\n<pre><code># [Cell1]. You can use the      the current directory of your choice.\n% tmp_dl/\n</code></pre>\n<pre><code>\n\n\n!kaggle datasets download harshitsheoran/simple-further-finetuned-bartley--models\n</code></pre>\n<p>With the above steps, you can download the file to any directory you like by moving to \"Cell1\".</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3221137,
      "author_name": "i2nfinit3y",
      "author_url": "",
      "post_date": "06/10/2025 13:10:01",
      "content": "<p>Dataset have been uploaded on <a href=\"https://huggingface.co/datasets/ashynf/OpenFWI\" target=\"_blank\">Huggingface</a>. You can download files by huggingface-cli. Or you can also download the specific file by wget command with link got in the huggingface repository.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3218619": "Hi,\n\"The competition datasets are very large. I only want to download the dataset inside a specific folder. Is it possible? I checked the API resources, but it downloads the entire dataset every time with the code I wrote.\nExample of the dataset I want to download:\n/kaggle/input/waveform-inversion/train_samples/CurveFault_A/seis2_1_0.npy\"\nThanks.",
    "3218627": "Hi.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fefa033ae71c32b39385aba3fd943e080%2FSin%20ttulo.png?generation=1749215289014752&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8722753%2Fa5dd1b73614f4e5a42621e94f0359b9a%2FSin%20ttulo.png?generation=1749215422812773&alt=media)",
    "3218652": "I guess what he wanted to ask was how to download using the api instead of the web. Maybe he wanted to download to the server. I know that too, but does huggingface have this function😀",
    "3218740": "So, how can I download /kaggle/input/waveform-inversion/train_samples/CurveFault_A as a folder? I guess I need to use the API for that.",
    "3218745": "No, you don't have to. You can just maual download any folder/file in data individually.",
    "3218973": "It should be possible according to the api documentation at https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md ?\n\nIt provides an example of how to download a specific competition file:\n\n```python\nkaggle competitions download favorita-grocery-sales-forecasting -f test.csv.7z\n\n```\nI tried it and ... it does not work!\n\nAccording to the doc, this should return the files we can download:\n\n```python\nkaggle competitions files -c waveform-inversion\n\n```\n\nIt yields:\n\n```python\nNext Page Token = <REDACTED>\nname                       size  creationDate                \n-------------------  ----------  --------------------------  \ntest/000039dca2.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0000fd8ec8.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0001026c8a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00015b24d5.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0001e348d0.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00020458d3.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0002189478.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0002c6e0ec.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0004e3da8f.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0005b32004.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0005f54789.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00073adee0.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000771e81b.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00080a15bb.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00085bb25a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/00092264ec.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000950ea2a.npy     1400128  2025-04-08 19:45:25.389000  \ntest/0009af4c76.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000a5e83b8.npy     1400128  2025-04-08 19:45:25.389000  \ntest/000ad94382.npy     1400128  2025-04-08 19:45:25.389000  \n```\n\nThis should download the first one:\n\n```python\nkaggle competitions download -f test/000039dca2.npy waveform-inversion\n```\n\nIt returns a 404 error instead.\n\n@inversion is the above to be expected?",
    "3221120": "FYI. For example, it would be easier to download the entire file to external storage and then store only the files you need on internal storage.\nYou can use magic commands to download files to a specified directory using the Kaggle CLI on local Notebook.\n```\n# [Cell1]. You can use the \"%cd\" command to change to the current directory of your choice.\n%cd tmp_dl/\n```\n\n```\n# [Cell2]. Copy and paste the Kaggle CLI command for the dataset you want to download and the download will begin.\n\n#!/bin/bash\n!kaggle datasets download harshitsheoran/simple-further-finetuned-bartley-open-models\n```\n\nWith the above steps, you can download the file to any directory you like by moving to \"Cell1\".",
    "3221137": "Dataset have been uploaded on [Huggingface](https://huggingface.co/datasets/ashynf/OpenFWI). You can download files by huggingface-cli. Or you can also download the specific file by wget command with link got in the huggingface repository."
  },
  "source": "meta"
}