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/75771c7c20fe7a121d596299c5440aef10c6f884/

Response

Body
[
    {
        "checksums": {
            "sha1": "de8e10f5a5256c37c9ba81a8b4c1fa07f1d93ade",
            "sha1_git": "526cffbce028f8515f48492f624ba4c360b2c8c4",
            "sha256": "54bbfc45e90ac8d0a7c3c4419ce1e74bf977c695efb752e4f624ff5b2a7c5610"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 5310,
        "name": "Python.asdl",
        "perms": 33188,
        "status": "visible",
        "target": "526cffbce028f8515f48492f624ba4c360b2c8c4",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:526cffbce028f8515f48492f624ba4c360b2c8c4/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "710ff20005002253c56b8998c1284aaabb427f46",
            "sha1_git": "9b14263b461ace5d22b40a80d9bc2942978e81af",
            "sha256": "728cb8a5570f0da567c22b0a41931f9daae20ae8c1693dbec8cf740da5f3cacd"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 3354,
        "name": "acceler.c",
        "perms": 33188,
        "status": "visible",
        "target": "9b14263b461ace5d22b40a80d9bc2942978e81af",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:9b14263b461ace5d22b40a80d9bc2942978e81af/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "56868568cc572b148a5baf9be062e7eabb6755fc",
            "sha1_git": "62f5c19c99fd711455db750df3b07978dfa0b3a2",
            "sha256": "6b9d6d23991268bc16af70adbab4e3a5c8be3c15bcf5af6359baeddebca736c5"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 12881,
        "name": "asdl.py",
        "perms": 33188,
        "status": "visible",
        "target": "62f5c19c99fd711455db750df3b07978dfa0b3a2",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:62f5c19c99fd711455db750df3b07978dfa0b3a2/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "b613569c7e5491f4cec02853fe7a30d2acfcfd95",
            "sha1_git": "096f5f8c7494f73b43ac89e4ac4a5729469fa4f2",
            "sha256": "5dfda052b89435d50f9062dbfb477060115a783c95b1c08c46b5e2009931ae63"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 44576,
        "name": "asdl_c.py",
        "perms": 33188,
        "status": "visible",
        "target": "096f5f8c7494f73b43ac89e4ac4a5729469fa4f2",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:096f5f8c7494f73b43ac89e4ac4a5729469fa4f2/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "391f7b27c730c41e2b8c4ba7c9ca99dbef1d5952",
            "sha1_git": "f5bfd41bd653b2ae0bcc6f882f180a968a5689aa",
            "sha256": "1fcda02f868db95d1653ee7e2cfe56badc3e9605280226f5cec1ac15c9f7518b"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 1065,
        "name": "bitset.c",
        "perms": 33188,
        "status": "visible",
        "target": "f5bfd41bd653b2ae0bcc6f882f180a968a5689aa",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:f5bfd41bd653b2ae0bcc6f882f180a968a5689aa/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "d3704071d3a99a6cdf70a7e18d4f3adced2634bb",
            "sha1_git": "ee75d1bfe067d80e441bb91d16b6b8a78fc12706",
            "sha256": "6d3aa9931824431f3f75b2e36136e44dcd56d51236af03a75535c73d7dfddac5"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 2854,
        "name": "firstsets.c",
        "perms": 33188,
        "status": "visible",
        "target": "ee75d1bfe067d80e441bb91d16b6b8a78fc12706",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:ee75d1bfe067d80e441bb91d16b6b8a78fc12706/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "505f8d66f0e05313c46ddef4a28a097f5cef39f7",
            "sha1_git": "75fd5b9cde5052933cc8f0a47968962f0a4471d4",
            "sha256": "bcfa514aa6bff3a5a74e15eb50e6108f1d5f8c3f4528fe227c4389800a4f6a77"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 7621,
        "name": "grammar.c",
        "perms": 33188,
        "status": "visible",
        "target": "75fd5b9cde5052933cc8f0a47968962f0a4471d4",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:75fd5b9cde5052933cc8f0a47968962f0a4471d4/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "c79daadce0af14525ba41ed728ad0a566e99b875",
            "sha1_git": "30a6f07cad94ea0f1047f40a170e662ad529543a",
            "sha256": "e54c202a78c154768f5695d6cdffbdeea7926d32e320e282bab8cba662f21a0a"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 1296,
        "name": "grammar1.c",
        "perms": 33188,
        "status": "visible",
        "target": "30a6f07cad94ea0f1047f40a170e662ad529543a",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:30a6f07cad94ea0f1047f40a170e662ad529543a/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "633f2efbd00efd0969315bea37cb408dd1c57fd7",
            "sha1_git": "71300ae908ae155753da4b088633a296d390fa60",
            "sha256": "6137e4e13b3167ee0fb3ffe2f234ec44c1ce1967f5e52b167de3673cc44846a8"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 1283,
        "name": "listnode.c",
        "perms": 33188,
        "status": "visible",
        "target": "71300ae908ae155753da4b088633a296d390fa60",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:71300ae908ae155753da4b088633a296d390fa60/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "c2e1056e6cb2df7778de0a74e60c5f178a84d618",
            "sha1_git": "53810b8125523b060fb8d46fab5e18e02e140806",
            "sha256": "abc69d89b3fa288ae89d155f0351063a2bd7be293f469819a84f471fbec92630"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 2474,
        "name": "metagrammar.c",
        "perms": 33188,
        "status": "visible",
        "target": "53810b8125523b060fb8d46fab5e18e02e140806",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:53810b8125523b060fb8d46fab5e18e02e140806/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "372ba8180a2bfcd8add8338faf0b49d0dca423a6",
            "sha1_git": "9f3c2e343c032cf7af9a68149cacee6bbb317e68",
            "sha256": "c050f4454768e442c50e5ce25ca6d338061feb01f9e23cc43db8921121ba16c4"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 10092,
        "name": "myreadline.c",
        "perms": 33188,
        "status": "visible",
        "target": "9f3c2e343c032cf7af9a68149cacee6bbb317e68",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:9f3c2e343c032cf7af9a68149cacee6bbb317e68/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "a61a308d01b1bb6597938ee80552dd2f22f38cd0",
            "sha1_git": "240d29057c4ef12f93c4982c0bf7972f0619b3a0",
            "sha256": "da8f210b46ad692a3c0c83871f41e8bb9b0116db4511d75a08045de0eb00136b"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 4538,
        "name": "node.c",
        "perms": 33188,
        "status": "visible",
        "target": "240d29057c4ef12f93c4982c0bf7972f0619b3a0",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:240d29057c4ef12f93c4982c0bf7972f0619b3a0/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "43009938c8730deb1c32df9b77d140a211d0e6a3",
            "sha1_git": "41072c478c26df90018a9e20cb4adf6efb1e1e38",
            "sha256": "cff518b89278d3bb21dd49126b0d6b7c0396bb8ad4d3f3c7e6ac67a84e58f43d"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 11845,
        "name": "parser.c",
        "perms": 33188,
        "status": "visible",
        "target": "41072c478c26df90018a9e20cb4adf6efb1e1e38",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:41072c478c26df90018a9e20cb4adf6efb1e1e38/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "e221437017c3bd9793536259048f3f9fdecfbbf3",
            "sha1_git": "403236d1ea2b87cdedea2003df3f1e8a7bb0e7a9",
            "sha256": "0323b279abceb4a2c3799c4e029863161f8789ae2884caaf63879337a79e2488"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 1042,
        "name": "parser.h",
        "perms": 33188,
        "status": "visible",
        "target": "403236d1ea2b87cdedea2003df3f1e8a7bb0e7a9",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:403236d1ea2b87cdedea2003df3f1e8a7bb0e7a9/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "7837d013c3a39a9746032f96919ee0a92fcb2c54",
            "sha1_git": "1f467d63c41e24e10e908dd6003dc3f028cfd773",
            "sha256": "426895073812890fc89cd6e7ac5878ef5ff31a61ac9191120ba06f82d778ef63"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 10807,
        "name": "parsetok.c",
        "perms": 33188,
        "status": "visible",
        "target": "1f467d63c41e24e10e908dd6003dc3f028cfd773",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:1f467d63c41e24e10e908dd6003dc3f028cfd773/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "1d263266a1a9e58661bf8c3fc7a5bb54fbe1695a",
            "sha1_git": "97b92883f3f49fb6c463ebbb7b0c0074a3e3fd49",
            "sha256": "b817b864ac12c124ce173225b4b0d1f7985f357f42eae6931982fcfeb4089b7a"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 35,
        "name": "parsetok_pgen.c",
        "perms": 33188,
        "status": "visible",
        "target": "97b92883f3f49fb6c463ebbb7b0c0074a3e3fd49",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:97b92883f3f49fb6c463ebbb7b0c0074a3e3fd49/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "a9eaabfbfeaa97c64a197676b50aefe1f63c1b9f",
            "sha1_git": "6451a1d99866f0dc6b3118eb259d06c390459fc0",
            "sha256": "4d7f6d850811a1b577bcafff3e7aaa2cd17a4b279bde94db93feb0d15d2e04da"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 18319,
        "name": "pgen.c",
        "perms": 33188,
        "status": "visible",
        "target": "6451a1d99866f0dc6b3118eb259d06c390459fc0",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:6451a1d99866f0dc6b3118eb259d06c390459fc0/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "a5264152abb50d78185e1225bdb12a41cf2e86af",
            "sha1_git": "e386248c2f8226467a86b11c3a8cf4524e70a634",
            "sha256": "6b26e95941fff8bd6bc0c0247823aa9e579b48bf0d128bda6da2c2fbfb1a991b"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 4093,
        "name": "pgenmain.c",
        "perms": 33188,
        "status": "visible",
        "target": "e386248c2f8226467a86b11c3a8cf4524e70a634",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:e386248c2f8226467a86b11c3a8cf4524e70a634/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "0a4d1816905860ed39fcf84688b637c6f5b167c9",
            "sha1_git": "7311e55170dee84bcd97729072cbe76027a824ee",
            "sha256": "8de5f0f62ecf155d417882a420517aedfa78a044d9473fafaefe5fd60caec433"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 3005,
        "name": "printgrammar.c",
        "perms": 33188,
        "status": "visible",
        "target": "7311e55170dee84bcd97729072cbe76027a824ee",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:7311e55170dee84bcd97729072cbe76027a824ee/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "92f8ada8dc4616f531d1e514e2eac18338186e78",
            "sha1_git": "5cc9533c3cd7bae320522beb20d1d00ff3b11e54",
            "sha256": "2f8a2f218d66a3f5171453915bbf9cb10a3b1d3eda6b912ae78be22ef476d8a6"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 55621,
        "name": "tokenizer.c",
        "perms": 33188,
        "status": "visible",
        "target": "5cc9533c3cd7bae320522beb20d1d00ff3b11e54",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:5cc9533c3cd7bae320522beb20d1d00ff3b11e54/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "778e89728650b1041d1133360143453f56d3d27c",
            "sha1_git": "0ad3551c8948c15cb1da8d49e276eb565bcac011",
            "sha256": "77d65a53ecdd3c6cd097e523dad4d3558237476e3e88abadbd8f8b548fdb2ec2"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 3728,
        "name": "tokenizer.h",
        "perms": 33188,
        "status": "visible",
        "target": "0ad3551c8948c15cb1da8d49e276eb565bcac011",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:0ad3551c8948c15cb1da8d49e276eb565bcac011/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "c05786a12ed79a4879d1136939a7d85651fd741d",
            "sha1_git": "9cb8492d6a647bc13050188e15c76a44b3944e32",
            "sha256": "e915b7b622e4324f27e485e63e363809cb549d31c885a157ec98eb6edce6ef5b"
        },
        "dir_id": "75771c7c20fe7a121d596299c5440aef10c6f884",
        "length": 36,
        "name": "tokenizer_pgen.c",
        "perms": 33188,
        "status": "visible",
        "target": "9cb8492d6a647bc13050188e15c76a44b3944e32",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:9cb8492d6a647bc13050188e15c76a44b3944e32/",
        "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