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
  • type (string) – the type of software origin (deprecated value; types are now associated to visits instead of origins)
  • id (number) – the origin unique identifier (deprecated value; you should only refer to origins based on their URL)
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

Example:

https://archive.softwareheritage.org/api/1/origin/git/url/https://github.com/python/cpython/
GET /api/1/origin/(origin_id)/

Get information about a software origin.

Warning

All endpoints using an origin_id or an origin_type are deprecated and will be removed in the near future. Only those using an origin_url will remain available. You should use GET /api/1/origin/(origin_url)/get/ instead.

Parameters:
  • origin_id (int) – a software origin identifier
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
  • type (string) – the type of software origin (deprecated value; types are now associated to visits instead of origins)
  • id (number) – the origin unique identifier (deprecated value; you should only refer to origins based on their URL)
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

Example:

https://archive.softwareheritage.org/api/1/origin/1/
GET /api/1/origin/(origin_type)/url/(origin_url)/

Get information about a software origin.

Warning

All endpoints using an origin_id or an origin_type are deprecated and will be removed in the near future. Only those using an origin_url will remain available. You should use GET /api/1/origin/(origin_url)/get/ instead.

Parameters:
  • origin_type (string) – the origin type (possible values are git, svn, hg, deb, pypi, npm, ftp or deposit)
  • 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
  • type (string) – the type of software origin (deprecated value; types are now associated to visits instead of origins)
  • id (number) – the origin unique identifier (deprecated value; you should only refer to origins based on their URL)
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

Example:

https://archive.softwareheritage.org/api/1/origin/git/url/https://github.com/python/cpython/
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.

Parameters:
  • url_pattern (string) – a string pattern or a regular expression
Query Parameters:
 
  • offset (int) – the number of found origins to skip before returning results
  • limit (int) – the maximum number of found origins to return
  • regexp (boolean) – if true, consider provided pattern as a regular expression and search origins whose urls match it
  • 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
  • type (string) – the type of software origin (deprecated value; types are now associated to visits instead of origins)
  • id (number) – the origin unique identifier (deprecated value; you should only refer to origins based on their URL)
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

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) or application/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

>jsonarrarr string snapshot_url:
 

link to GET /api/1/snapshot/(snapshot_id)/ in order to get information about the snapshot of the visit

Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

Example:

https://archive.softwareheritage.org/api/1/origin/https://github.com/hylang/hy/visits/
GET /api/1/origin/(origin_id)/visits/

Get information about all visits of a software origin. Visits are returned sorted in descending order according to their date.

Warning

All endpoints using an origin_id are deprecated and will be removed in the near future. Only those using an origin_url will remain available. Use GET /api/1/origin/(origin_url)/visits/ instead.

Parameters:
  • origin_id (int) – a software origin identifier
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) or application/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

>jsonarrarr string snapshot_url:
 

link to GET /api/1/snapshot/(snapshot_id)/ in order to get information about the snapshot of the visit

Allowed HTTP Methods: GET, HEAD,
OPTIONS
Status Codes:

Example:

https://archive.softwareheritage.org/api/1/origin/1/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) or application/yaml
Response Headers:
 
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
  • snapshot_url (string) – link to GET /api/1/snapshot/(snapshot_id)/ in order to get information about the snapshot of the visit
Allowed HTTP Methods: GET, HEAD,
OPTIONS
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/
GET /api/1/origin/(origin_id)/visit/(visit_id)/

Get information about a specific visit of a software origin.

Warning

All endpoints using an origin_id are deprecated and will be removed in the near future. Only those using an origin_url will remain available. Use GET /api/1/origin/(origin_url)/visit/(visit_id) instead.

Parameters:
  • origin_id (int) – a software origin identifier
  • visit_id (int) – a visit identifier
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
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
  • snapshot_url (string) – link to GET /api/1/snapshot/(snapshot_id)/ in order to get information about the snapshot of the visit
Allowed HTTP Methods: GET, HEAD,
OPTIONS
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/1500/visit/1/