Origin¶
-
GET
/api/1/origin/
(origin_url)/get/
¶ Get information about a software origin.
- Parameters
origin_url (string) – the origin url
- Response JSON Object
origin_visits_url (string) – link to in order to get information about the visits for that origin
url (string) – the origin canonical url
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
- Status Codes
200 OK – no error
404 Not Found – requested origin can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/origin/https://github.com/python/cpython/get/
-
GET
/api/1/origin/search/
(url_pattern)/
¶ Search for software origins whose urls contain a provided string pattern or match a provided regular expression. The search is performed in a case insensitive way.
Warning
This endpoint used to provide an offset query parameter, and guarantee an order on results. This is no longer true, and only the Link header should be used for paginating through results.
- Parameters
url_pattern (string) – a string pattern
- Query Parameters
limit (int) – the maximum number of found origins to return (bounded to 1000)
with_visit (boolean) – if true, only return origins with at least one visit by Software heritage
- Response JSON Array of Objects
origin_visits_url (string) – link to in order to get information about the visits for that origin
url (string) – the origin canonical url
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
Link – indicates that a subsequent result page is available and contains the url pointing to it
- Status Codes
200 OK – no error
Example:
https://archive.softwareheritage.org/api/1/origin/search/python/?limit=2
-
GET
/api/1/origin/
(origin_url)/visits/
¶ Get information about all visits of a software origin. Visits are returned sorted in descending order according to their date.
- Parameters
origin_url (str) – a software origin URL
- Query Parameters
per_page (int) – specify the number of visits to list, for pagination purposes
last_visit (int) – visit to start listing from, for pagination purposes
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
Link – indicates that a subsequent result page is available and contains the url pointing to it
- Response JSON Array of Objects
date (string) – ISO representation of the visit date (in UTC)
origin (str) – the origin canonical url
origin_url (string) – link to get information about the origin
status (string) – status of the visit (either full, partial or ongoing)
visit (number) – the unique identifier of the visit
id (number) – the unique identifier of the origin
origin_visit_url (string) – link to
GET /api/1/origin/(origin_url)/visit/(visit_id)/
in order to get information about the visit
- >jsonarrarr string snapshot
the snapshot identifier of the visit (may be null if status is not full).
- >jsonarrarr string snapshot_url
link to
GET /api/1/snapshot/(snapshot_id)/
in order to get information about the snapshot of the visit (may be null if status is not full).- Status Codes
200 OK – no error
404 Not Found – requested origin can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/origin/https://github.com/hylang/hy/visits/
-
GET
/api/1/origin/
(origin_url)/visit/
(visit_id)/
¶ Get information about a specific visit of a software origin.
- Parameters
origin_url (str) – a software origin URL
visit_id (int) – a visit identifier
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
- Response JSON Object
date (string) – ISO representation of the visit date (in UTC)
origin (str) – the origin canonical url
origin_url (string) – link to get information about the origin
status (string) – status of the visit (either full, partial or ongoing)
visit (number) – the unique identifier of the visit
- Response JSON Array of Objects
snapshot (string) – the snapshot identifier of the visit (may be null if status is not full).
snapshot_url (string) – link to
GET /api/1/snapshot/(snapshot_id)/
in order to get information about the snapshot of the visit (may be null if status is not full).
- Status Codes
200 OK – no error
404 Not Found – requested origin or visit can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/origin/https://github.com/hylang/hy/visit/1/