Description

Get information about directory objects. Directories are identified by sha1 checksums, compatible with Git directory identifiers. See swh.model.git_objects.directory_git_object in our data model module for details about how they are computed.

When given only a directory identifier, this endpoint returns information about the directory itself, returning its content (usually a list of directory entries). When given a directory identifier and a path, this endpoint returns information about the directory entry pointed by the relative path, starting path resolution from the given directory.

Request

GET https://archive.softwareheritage.org/api/1/directory/977fc4b98c0e85816348cebd3b12026407c368b6/

Response

Body
[
    {
        "checksums": {
            "sha1": "e2d79ae437210941840f49966497cc348c7e817f",
            "sha1_git": "58471109208922c9ee8c4b06135725f03ed16814",
            "sha256": "2b7001f4819e898776b45b2fa3411018b7bc24e38afbb351691c32508eb2ae5d"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 582,
        "name": ".bzrignore",
        "perms": 33188,
        "status": "visible",
        "target": "58471109208922c9ee8c4b06135725f03ed16814",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:58471109208922c9ee8c4b06135725f03ed16814/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f47aabb47381119cf72add7633bc095ca2cd030d",
            "sha1_git": "2106da61725973b81a63a817ec6f245706af4353",
            "sha256": "4f0475fac23bcd3ebceceecffb0d4facc5a413f6d9a0287185fb75638b8e9c69"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 453,
        "name": ".codecov.yml",
        "perms": 33188,
        "status": "visible",
        "target": "2106da61725973b81a63a817ec6f245706af4353",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:2106da61725973b81a63a817ec6f245706af4353/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "5daeb59981fe561fd5b4eb8761cd836a814ee540",
            "sha1_git": "82694d81f276b2c59a0a93a4f678e1852e625052",
            "sha256": "15051f8c9b4cbfc18d9dd5cf7a4fa96fa8d7ff1143413b4d3d9f71f795de780b"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 255,
        "name": ".gitattributes",
        "perms": 33188,
        "status": "visible",
        "target": "82694d81f276b2c59a0a93a4f678e1852e625052",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:82694d81f276b2c59a0a93a4f678e1852e625052/",
        "type": "file"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": ".github",
        "perms": 16384,
        "target": "b266746952a70c852d4f760b431c28affc6853e2",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/b266746952a70c852d4f760b431c28affc6853e2/",
        "type": "dir"
    },
    {
        "checksums": {
            "sha1": "4bc3fb4c5a1b998e258f3f83ca694fb20e25921b",
            "sha1_git": "f436777c7cf099c43c9f04ad31fe1551b4f6079d",
            "sha256": "ab427a61741fadbd0aa5eeb0f384dc74b5630fc878869d994a9c6d972d4854a9"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 1433,
        "name": ".gitignore",
        "perms": 33188,
        "status": "visible",
        "target": "f436777c7cf099c43c9f04ad31fe1551b4f6079d",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:f436777c7cf099c43c9f04ad31fe1551b4f6079d/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f731523ff2ffbaf91d5f34000af8ec5875d5d63b",
            "sha1_git": "eb19a6c88d28d05588db25d21525ee2e19c22666",
            "sha256": "426003d52cd302a75d4d1bf56ce0a3aa5740d06dfa9267f4901cfd1b038b6169"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 1060,
        "name": ".hgeol",
        "perms": 33188,
        "status": "visible",
        "target": "eb19a6c88d28d05588db25d21525ee2e19c22666",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:eb19a6c88d28d05588db25d21525ee2e19c22666/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "173cafb7f9d6e034287f24f0a8353580c7f05e1e",
            "sha1_git": "68c607f2e8d420c8dfd0748efcd3b3b5447def16",
            "sha256": "191069e0e1aa07b0345c82d3d06226b6bc7b55b4eb83e5279b43a8139a8b6f73"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 1358,
        "name": ".hgignore",
        "perms": 33188,
        "status": "visible",
        "target": "68c607f2e8d420c8dfd0748efcd3b3b5447def16",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:68c607f2e8d420c8dfd0748efcd3b3b5447def16/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f3e049dcf85963f453fd2efd3af819bc8e8eabcd",
            "sha1_git": "8f51c2ced49aed46d8b480280b630ea4264c57c3",
            "sha256": "1d8f5495b39ace89c290f45383936127256f80d9789971fd35208aaf18ab7cb8"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 8917,
        "name": ".hgtags",
        "perms": 33188,
        "status": "visible",
        "target": "8f51c2ced49aed46d8b480280b630ea4264c57c3",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:8f51c2ced49aed46d8b480280b630ea4264c57c3/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "23cbb97a62f86f68425e0b368eb824fca332c28e",
            "sha1_git": "482e241c4121b49c12d1fbca71cc7e89d9f30014",
            "sha256": "4f09c1b2d9242f035d5b6340a5a441e1e94cfc5eec720a4c4ae8974752e4e6c0"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 606,
        "name": ".mention-bot",
        "perms": 33188,
        "status": "visible",
        "target": "482e241c4121b49c12d1fbca71cc7e89d9f30014",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:482e241c4121b49c12d1fbca71cc7e89d9f30014/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "6f1625beca4e860503213da4c929a656b6569187",
            "sha1_git": "e7e8694530ca21a6d7a19da3fab687a3e9d79e9c",
            "sha256": "3ffd00254adef8ce24f8cb44fffcd2d02e72004ae9ca8e381d2eac6705cd50e1"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 3512,
        "name": ".travis.yml",
        "perms": 33188,
        "status": "visible",
        "target": "e7e8694530ca21a6d7a19da3fab687a3e9d79e9c",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:e7e8694530ca21a6d7a19da3fab687a3e9d79e9c/",
        "type": "file"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Doc",
        "perms": 16384,
        "target": "5717ef211e7c694471d41cd8626d46bbaf647c66",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/5717ef211e7c694471d41cd8626d46bbaf647c66/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Grammar",
        "perms": 16384,
        "target": "5dd6fc9dc09374506491247872c868eca111e256",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/5dd6fc9dc09374506491247872c868eca111e256/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Include",
        "perms": 16384,
        "target": "cd8b4bafaede5f4f9167489b08f32be2c9cc1cdd",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/cd8b4bafaede5f4f9167489b08f32be2c9cc1cdd/",
        "type": "dir"
    },
    {
        "checksums": {
            "sha1": "4dfc4478b1d5f7388b298fdfc06802485bdeae0c",
            "sha1_git": "f5d0b39a0cdddb91a31a537052b7d8d31a4aa79f",
            "sha256": "efc0c7f2994f95be25f7ce63a865f870e278ff0aa4f5d52d84d4d6d2a98128bd"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 12773,
        "name": "LICENSE",
        "perms": 33188,
        "status": "visible",
        "target": "f5d0b39a0cdddb91a31a537052b7d8d31a4aa79f",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:f5d0b39a0cdddb91a31a537052b7d8d31a4aa79f/",
        "type": "file"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Lib",
        "perms": 16384,
        "target": "175167e77c40211e439202598830c68aa9d45f86",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/175167e77c40211e439202598830c68aa9d45f86/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Mac",
        "perms": 16384,
        "target": "a8eb01b6b98ad20fa8f80d5c19c36ad27e36a6f1",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/a8eb01b6b98ad20fa8f80d5c19c36ad27e36a6f1/",
        "type": "dir"
    },
    {
        "checksums": {
            "sha1": "8c40fb0448a05a3e22cd760f8761ddd08f6093fd",
            "sha1_git": "12593a2b63ac937f37f78f6046d5d84fc78af171",
            "sha256": "acb089f45ca086407c1cf2fad7ea0603788871f9653c8e4fc9a1909808775752"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 59057,
        "name": "Makefile.pre.in",
        "perms": 33188,
        "status": "visible",
        "target": "12593a2b63ac937f37f78f6046d5d84fc78af171",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:12593a2b63ac937f37f78f6046d5d84fc78af171/",
        "type": "file"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Misc",
        "perms": 16384,
        "target": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/6d8ce40edd85daec3653450f3b9220c135acdaca/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Modules",
        "perms": 16384,
        "target": "64ab9e8e8b0edcec311a6fd4da7a8c6f290cfdd7",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/64ab9e8e8b0edcec311a6fd4da7a8c6f290cfdd7/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Objects",
        "perms": 16384,
        "target": "06e40820601a63a04fc9f9baa54c442dfbeb1a6c",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/06e40820601a63a04fc9f9baa54c442dfbeb1a6c/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "PC",
        "perms": 16384,
        "target": "b4df9f86f76a7e10a7d98259980d4f5d5d1223a1",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/b4df9f86f76a7e10a7d98259980d4f5d5d1223a1/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "PCbuild",
        "perms": 16384,
        "target": "1e837a7d204fd247fb9a105adaa758a6d63486d8",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/1e837a7d204fd247fb9a105adaa758a6d63486d8/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Parser",
        "perms": 16384,
        "target": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/75771c7c20fe7a121d596299c5440aef10c6f884/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Programs",
        "perms": 16384,
        "target": "3efbcc80237ab7c3d4eb5bf31c893ca6de88e747",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/3efbcc80237ab7c3d4eb5bf31c893ca6de88e747/",
        "type": "dir"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Python",
        "perms": 16384,
        "target": "8f0f7237dc78c4344badeb84c7a65e5b106faf26",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/8f0f7237dc78c4344badeb84c7a65e5b106faf26/",
        "type": "dir"
    },
    {
        "checksums": {
            "sha1": "1b80225a4c9c14af02eb89ad3ad5ba6a22c27c0b",
            "sha1_git": "9c95815d9e9d91b8dae8e05d8bbc696fe19f796b",
            "sha256": "4d7c3907715129e40bbea30608d922bb39864f232638af016082465fb9a384f3"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 9325,
        "name": "README.rst",
        "perms": 33188,
        "status": "visible",
        "target": "9c95815d9e9d91b8dae8e05d8bbc696fe19f796b",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:9c95815d9e9d91b8dae8e05d8bbc696fe19f796b/",
        "type": "file"
    },
    {
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": null,
        "name": "Tools",
        "perms": 16384,
        "target": "01cd5744570f4be57d9ece0e62b324ef5d0d29fb",
        "target_url": "https://archive.softwareheritage.org/api/1/directory/01cd5744570f4be57d9ece0e62b324ef5d0d29fb/",
        "type": "dir"
    },
    {
        "checksums": {
            "sha1": "a9fb2499c15f934a064bf3e9a59ce0516db01676",
            "sha1_git": "2a745e57466cae1af014f239e5b91a8fc1fd64d8",
            "sha256": "b062dd22e0803d82b381149d4ce30e58c7a2d2037a03e062c3e51160f1334fd8"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 10914,
        "name": "aclocal.m4",
        "perms": 33188,
        "status": "visible",
        "target": "2a745e57466cae1af014f239e5b91a8fc1fd64d8",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:2a745e57466cae1af014f239e5b91a8fc1fd64d8/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "3646b015d9a91423feaf2bac86fd2df7ab3564f6",
            "sha1_git": "1f5c50c0d1529d50b94dc3533ca72a47f0fa5849",
            "sha256": "47da33933b3825049bbc04871747a9598ce90fd45a438b6a8a58b74bf6d73a4d"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 42856,
        "name": "config.guess",
        "perms": 33261,
        "status": "visible",
        "target": "1f5c50c0d1529d50b94dc3533ca72a47f0fa5849",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:1f5c50c0d1529d50b94dc3533ca72a47f0fa5849/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "0a7de3085aaa4ea3655c4221574dc9e503035428",
            "sha1_git": "d654d03cdcd2226a5d7584890717e674a8122f4f",
            "sha256": "78e9582b4b87ebcd2d3e95db04b22469cd2a132fa78f9d336afdf851fe4c1bf9"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 35740,
        "name": "config.sub",
        "perms": 33261,
        "status": "visible",
        "target": "d654d03cdcd2226a5d7584890717e674a8122f4f",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:d654d03cdcd2226a5d7584890717e674a8122f4f/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "a1fd0fd26de1fa61d8479ee668133d2900f6f58b",
            "sha1_git": "c9340c68605483dd0dada2fb2c6ea315b7c74019",
            "sha256": "da1c3a1b44c761b12e846de5f7a724891cf4f3e4dd3751f3ef0a78ea2d616a60"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 484897,
        "name": "configure",
        "perms": 33261,
        "status": "visible",
        "target": "c9340c68605483dd0dada2fb2c6ea315b7c74019",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:c9340c68605483dd0dada2fb2c6ea315b7c74019/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "0b3c337c28885b966d7be1b1d3d6f7c18bddea42",
            "sha1_git": "e065ce554b4ec92b33fc8225aa45b0d3225bb98f",
            "sha256": "dacf2d5dc82ebb2452301de9637d09bdc467a4e774eb9062d2c0d4b74c57cee7"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 160603,
        "name": "configure.ac",
        "perms": 33188,
        "status": "visible",
        "target": "e065ce554b4ec92b33fc8225aa45b0d3225bb98f",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:e065ce554b4ec92b33fc8225aa45b0d3225bb98f/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "260ef3ac7ec99c50e8c45c82be49465d38f7bb89",
            "sha1_git": "0ec27bcd488da5cad6ead13d70accbdbc40d31ef",
            "sha256": "92adf3cf516747616fbe142306be804c8a7a6da49b85e0e1763d0aa4465f9fb6"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 7122,
        "name": "install-sh",
        "perms": 33261,
        "status": "visible",
        "target": "0ec27bcd488da5cad6ead13d70accbdbc40d31ef",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:0ec27bcd488da5cad6ead13d70accbdbc40d31ef/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f65fb4a417b2c3de4c38c8f5c036af9cf2727322",
            "sha1_git": "0a3d59ef9ae602fa02405c7b7068efaf7b55b21b",
            "sha256": "5a7daffa2605b620500924f62964df590f7ff562d12997937ed5305d979f9e3e"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 41198,
        "name": "pyconfig.h.in",
        "perms": 33188,
        "status": "visible",
        "target": "0a3d59ef9ae602fa02405c7b7068efaf7b55b21b",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:0a3d59ef9ae602fa02405c7b7068efaf7b55b21b/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "de26417bb7aa146bb6a9abfcfe820466e80f08fe",
            "sha1_git": "6a05643838bb4ef64ae093f7a0f816a80d6f09f4",
            "sha256": "c8d512dfe55b7d9503ee84c750e10724c7528ed1beb0b84c1b9ae82e82344ad8"
        },
        "dir_id": "977fc4b98c0e85816348cebd3b12026407c368b6",
        "length": 98894,
        "name": "setup.py",
        "perms": 33188,
        "status": "visible",
        "target": "6a05643838bb4ef64ae093f7a0f816a80d6f09f4",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:6a05643838bb4ef64ae093f7a0f816a80d6f09f4/",
        "type": "file"
    }
]

URL Allowed Methods

https://archive.softwareheritage.org/api/1/directory/ (sha1_git) /[ (path) /]

GET, HEAD, OPTIONS

Arguments

sha1_git (string)

hexadecimal representation of the directory sha1_git identifier

path (string)

optional parameter to get information about the directory entry pointed by that relative path


Request headers

Accept

the requested response content type, either application/json (default) or application/yaml


Response headers

Content-Type

this depends on Accept header of request


Returns

array

an array of objects containing the following keys:

  • checksums (object): object holding the computed checksum values for a directory entry (only for file entries)

  • dir_id (string): sha1_git identifier of the requested directory

  • length (number): length of a directory entry in bytes (only for file entries) for getting information about the content MIME type

  • name (string): the directory entry name

  • perms (number): permissions for the directory entry

  • target (string): sha1_git identifier of the directory entry

  • target_url (string): link to /api/1/content/ or /api/1/directory/ depending on the directory entry type

  • type (string): the type of the directory entry, can be either dir, file or rev


HTTP status codes

200

no error

400

an invalid hash_type or hash has been provided

404

requested directory cannot be found in the archive


Examples

/api/1/directory/977fc4b98c0e85816348cebd3b12026407c368b6/
back to top